softmax详细内容参考https://blog.csdn.net/u014380165/article/details/77284921
softmax公式:
tf.nn.softmax():
import tensorflow as tf
A = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
B = tf.nn.softmax(A)
with tf.Session() as sess:
print(sess.run(B))
#输出结果:
[0.00426978 0.01160646 0.03154963 0.08576079 0.233122 0.6336913 ]