[吃药深度学习随笔] 交叉熵

 

#TensorFlow函数
ce = -tf.reduce_mean(y_* tf.log(tf.clip_by_value(y, 1e-12, 1.0)))

#Tensorflow代码
ce = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=y, labels=tf.argmax(y_,1))

cem = tf.reduce_mean(ce)

 

posted @ 2018-05-21 00:02  吃药  阅读(124)  评论(0)    收藏  举报