【发布时间】:2018-06-27 06:38:00
【问题描述】:
我在 tensorflow 中有一个神经网络,它有三个隐藏层,输出层有两个神经元,它由一个热编码值表示(可能输出 0 或 1,因此 [1, 0] 和 [0, 1 ])。 输入层由 60 个神经元组成,隐藏层内的激活是 reLU,我使用学习率为 0.001 的 AdamOptimizer。 我在尝试计算网络模型的结果时遇到问题:
prediction - 代表网络输出的变量
prediction_run = sess.run(prediction, feed_dict={x: mydata.reshape(1, 60)})
print("Original class: ", [1, 0], "Predicted values: ", prediction_run)
这将输出: 原始类:[1. 0.] 预测值:[[ 1.00000000e+00 3.35827508e-08]]
由于 Im using the softmax in the final layer, isn't this supposed to be an output that will sum up to 1? Like a probability or something. Im 无法理解这些预测数字,因为 softmax 应该转换它们,但事实并非如此。
self.tf.nn.softmax(self.tf.matmul(last_hidden_layer_activation, `output_layer_weights) + output_layer_biases)
有什么想法吗?
【问题讨论】:
标签: tensorflow neural-network softmax