class_docstr: Calcualte LPIPS loss.
class_docstr_tok: ["Calcualte","LPIPS","loss","."]
docstr: Assuming inputs are in [0, 1].
docstr_tok: ["Assuming","inputs","are","in","[","0",",","1","]","."]
code: def __call__(self, fake_image, real_image):
      """Assuming inputs are in [0, 1]."""
  
      # Move inputs to [-1, 1] and NCHW format.
      def _transpose_to_nchw(x):
          return tf.transpose(x, (0, 3, 1, 2))
  
      fake_image = _transpose_to_nchw(fake_image * 2 - 1.0)
      real_image = _transpose_to_nchw(real_image * 2 - 1.0)
      loss = self._lpips_func(fake_image, real_image)
      return tf.reduce_mean(loss)
  
imports: import collections
  import glob
  import itertools
  from compare_gan.gans import loss_lib
  import tensorflow.compat.v1
  import tensorflow_datasets
  from hific import archs
  from hific import helpers
  from hific.helpers import ModelMode
  from hific.helpers import ModelType
  from hific.helpers import TFDSArguments
label_desc: Use image node_id 2 for calling the LPIPSLoss obj's underlying member method code with example usage: obj.__call__(fake_image, real_image) and returns: tf, tf