tf.contrib.gan.eval.classifier_score( images, classifier_fn, num_batches=1 )
Classifier score for evaluating a conditional generative model.
This is based on the Inception Score, but for an arbitrary classifier.
This technique is described in detail in https://arxiv.org/abs/1606.03498. In summary, this function calculates
exp( E[ KL(p(y|x) || p(y)) ] )
which captures how different the network's classification prediction is from the prior distribution over classes.
NOTE: This function consumes images, computes their logits, and then computes the classifier score. If you would like to precompute many logits for large batches, use classifier_score_from_logits(), which this method also uses.
images: Images to calculate the classifier score for.
classifier_fn: A function that takes images and produces logits based on a classifier.
num_batches: Number of batches to split
generated_imagesin to in order to efficiently run them through the classifier network.
The classifier score. A floating-point scalar of the same type as the output of
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.