def evaluation(logits, labels):
prediction = tf.argmax(logits, 2)
prediction = tf.cast(prediction, tf.int32)
equal = tf.equal(prediction, labels)
equal_all = tf.reduce_all(equal, axis=1)
accuracy = tf.reduce_mean(tf.cast(equal_all, tf.float32), name="accuracy")
return accuracy
评论列表
文章目录