, 나는 correct_predition
우리는 tensorflow에서 softmax로 tf.arg_max (Y, 1)가 필요한 이유는 무엇입니까? 나는 tensorflow 데모를 쓸 때
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))
의 정의에이 arg_max()
기능을 찾을 수는 텐서의 축에서 가장 큰 값으로 인덱스를 돌려줍니다.는
우리가 최대의 인덱스를 얻을 확률으로 표시하고 있습니다
우리가 'softmax_cross_entropy_with_logits
'를 사용하기위한,
예측 (hypothesis
) (이 TF에서 API에서입니다) arg_max()
에 대한 예측 가능성 hypothesis
그러나 Y
은 레이블 입니다. 왜 우리는 사용이 필요하지 않습니다 tf.arg_max(Y,1)
?
감사합니다. *** Y는 길이 10 핫 벡터입니다. ***이 질문에 중요합니다. –