Hi,
Cross-entropy with weights is defined as follows [1]:
loss(x,class) = weight[class](−x[class] + log(∑_j ​exp(x[j])))
Why the normalization term (denominator of softmax regression) is weighted by weight[class], too? Shouldn’t it be the sum of weighted exponentials as below?
loss(x,class) = −weight[class]*x[class] + log( ∑_j (weight[j] * exp(x[j])))
[1] CrossEntropyLoss — PyTorch 1.7.0 documentation 11