If the accuracy for each class of my model is [0.7, 0.8, 0.2], can I improve the performance of the last class by applying the weight as [1,1,2] in cross-entropy ?
When I applied the weight as [1,1,2], I thought the loss would be different from that of ces1. But it gives the same value. Why is that?
The weighting should balance the losses and might thus also balance the accuracy. I.e. while the class2 accuracy might increase the other two might decrease.
Your current target might not use the class2 index. This code shows the difference: