我在tensorflow中有一个神经网络,它有三个隐层,输出层有两个神经元,它用一个热编码值表示(可能输出0或1 SO1,0和0,1)。输入层由60个神经元组成,隐层内的激活为reLU,我使用AdamOptimizer,学习率为0.001。当我试图计算网络模型的结果时,我遇到了一个问题:
预测-表示网络输出的变量
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]
因为我m 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. I无法理解那些预测的数字,因为softmax应该对它们进行转换,但它们不是。
self.tf.nn.softmax(self.tf.matmul(last_hidden_layer_activation, `output_layer_weights) + output_layer_biases)有什么想法吗?
发布于 2018-01-18 08:55:28
你是正确的。Softmax输出应与1之和。
问题是浮点数。在浮点数的情况下,没有绝对零度这样的东西。浮点数总是有一点不确定。更多信息这里
https://stackoverflow.com/questions/48317073
复制相似问题