Okay, going back to the multi-class issue. Say I’ve 3 classes each having following the number of labels
Class 1 : 3711
Class 2 : 7107
Class 3 : 2942
I was wondering if there’s any other way to assign class weights rather than just inversion like this
weight = 1.0 / torch.Tensor([3711,7107,2942], dtype = torch.float)
criterion = nn.CrossEntropyLoss(weight=weight)
And also do we have to follow any intuitive rule like all the weights have to equal to something?