def evaluation(loss, batch_size=100):
"""Evaluate the quality of the logits at predicting the label.
"""
ruler = tf.constant(0.5, shape=[batch_size, 1])
loss_l = tf.reshape(loss, [batch_size, 1])
comp = tf.concat(1, [ruler, loss_l])
correct = tf.argmin(comp, 1)
# Return the number of entries less than 0.5
return tf.reduce_sum(correct)
评论列表
文章目录