Getting Probabilities of Outputs for CIFAR Example (or similar)

前端 未结 1 1655
清酒与你
清酒与你 2021-01-24 08:52

Hey I\'m trying to figure out how to get the probabilities for each of the classes in the CIFAR example. Currently I can input the predicted class in the input tensor and get ba

相关标签:
1条回答
  • 2021-01-24 09:20

    The CIFAR-10 example code for evaluation (in cifar10_eval.py) produces (as an intermediate output) a logits tensor that contains log-probabilities that a given image is in each of the classes. Passing this tensor to sess.run() will give you the necessary information to tell you what the predicted class for an image is. If instead you compute tf.nn.softmax(logits) and pass that to sess.run(), you will get a probability (ranging from 0 to 1) for each class.

    0 讨论(0)
提交回复
热议问题