【发布时间】:2017-09-28 17:47:18
【问题描述】:
我在写tensorflow demo的时候,在correct_predition
arg_max()函数
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(
logits=hypothesis,labels=Y))
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
correct_prediction = tf.equal(tf.arg_max(hypothesis,1),tf.arg_max(Y,1))
返回张量轴上具有最大值的索引。(来自 TF 的 API)
因为我们使用'softmax_cross_entropy_with_logits',
预测 (hypothesis) 表示为概率
我们将通过arg_max()函数得到hypothesis
但是Y是标签,这不是我们需要使用tf.arg_max(Y,1)的概率?
【问题讨论】:
标签: label softmax hypothesis-test argmax