Created
July 16, 2018 18:59
-
-
Save risenW/931de501ae04ec6d370f57823ac70df1 to your computer and use it in GitHub Desktop.
code for Softmax cross entropy loss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y_pred_dist = tf.constant([[1., -3., 10.]]) | |
target_dist = tf.constant([[0.1, 0.02, 0.88]]) | |
softmax_xentropy = tf.nn.softmax_cross_entropy_with_logits(labels=target_dist, logits=y_pred_dist) | |
print(sess.run(softmax_xentropy)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment