tensorflow_gan/python/eval/classifier_metrics.py [475:522]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                input_tensor2,
                                classifier_fn,
                                num_batches=1):
  """Classifier distance for evaluating a generative model.

  This is based on the Frechet Inception distance, but for an arbitrary
  classifier.

  This technique is described in detail in https://arxiv.org/abs/1706.08500.
  Given two Gaussian distribution with means m and m_w and covariance matrices
  C and C_w, this function calculates

              |m - m_w|^2 + Tr(C + C_w - 2(C * C_w)^(1/2))

  which captures how different the distributions of real images and generated
  images (or more accurately, their visual features) are. Note that unlike the
  Inception score, this is a true distance and utilizes information about real
  world images.

  Note that when computed using sample means and sample covariance matrices,
  Frechet distance is biased. It is more biased for small sample sizes. (e.g.
  even if the two distributions are the same, for a small sample size, the
  expected Frechet distance is large). It is important to use the same
  sample size to compute Frechet classifier distance when comparing two
  generative models.

  NOTE: This function consumes inputs, computes their activations, and then
  computes the classifier score. If you would like to precompute many
  activations for large batches, please use
  frechet_clasifier_distance_from_activations(), which this method also uses.

  Args:
    input_tensor1: First tensor to use as inputs.
    input_tensor2: Second tensor to use as inputs.
    classifier_fn: A function that takes tensors and produces activations based
      on a classifier.
    num_batches: Number of batches to split images in to in order to efficiently
      run them through the classifier network.

  Returns:
    The Frechet Inception distance. A floating-point scalar of the same type
    as the output of `classifier_fn`.
  """
  return _frechet_classifier_distance_helper(
      input_tensor1,
      input_tensor2,
      classifier_fn,
      num_batches,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tensorflow_gan/python/eval/classifier_metrics.py [527:552]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                          input_tensor2,
                                          classifier_fn,
                                          num_batches=1):
  """A streaming version of frechet_classifier_distance.

  Keeps an internal state that continuously tracks the score. This internal
  state should be initialized with tf.initializers.local_variables().

  Args:
    input_tensor1: First tensor to use as inputs.
    input_tensor2: Second tensor to use as inputs.
    classifier_fn: A function that takes tensors and produces activations based
      on a classifier.
    num_batches: Number of batches to split images in to in order to efficiently
      run them through the classifier network.

  Returns:
    A tuple containing the classifier score and a tf.Operation. The tf.Operation
    has the same value as the score, and has an additional side effect of
    updating the internal state with the given tensors.
  """
  return _frechet_classifier_distance_helper(
      input_tensor1,
      input_tensor2,
      classifier_fn,
      num_batches,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



