关于functional里的cross_entropy_with_softmax的使用

在用RetinaNet模型训练COCO数据集时,想试试交叉熵,可是写测试语句时不理解为什么交叉熵会很小呢~
logits (Tensor): the predicted logits with the shape of :math:(B, A, C)
labels (Tensor):the assigned labels of boxes with shape of :math:(B, A)
loss = F.cross_entropy_with_softmax(logits.reshape(-1,80), labels.reshape(-1).astype(“int32”))

loss只有4点多,是交叉熵本来都很小呢,还是这样计算方式有问题呢~

如果交叉熵本来就很小,平均后,类别置信度损失就只有0.0几了,这个问题不太懂

cross_entropy_with_softmax 返回的已经是平均后的loss。对于随机数据,返回值 ~ ln(N), 其中N是分类数目。比如N=10, ~ 2.3, N=100, ~4.6

1赞