我知道二元交叉熵与两类中的分类交叉熵相同。 此外,我很清楚softmax是什么。 因此,我看到明确的交叉熵惩罚只是将一个部件(概率)应为1。 但为什么,不能或不应我使用二进制交叉熵上一热载体? Normal Case for 1-Label-Multiclass-Mutual-exclusivity-classification:
################
pred = [0.1
这里是我的代码: import tensorflow as tf
with tf.Session() as sess:
y = tf.constant([0,0,1])
x = tf.constant([0,1,0])
r = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=y, logits