Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2018
What would you like to do?
Softmax using TensorFlow
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment