Created
May 11, 2018 07:42
-
-
Save mohanr/94f272fa76339f08c8e3edfc21856abc to your computer and use it in GitHub Desktop.
Softmax using TensorFlow
This file contains hidden or 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
import tensorflow as tf | |
import numpy as np | |
v = tf.constant([1.,-2.,0.5]) | |
tv = tf.convert_to_tensor(v,dtype=np.float32) | |
with tf.Session() as sess: | |
x = tf.nn.softmax(tv) | |
tf.Print(x, [x], message="Softmax") | |
print(sess.run(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment