Right now I am penalizing the imbalanced classes by assigning the following weight vector in CrossEntropyLoss:
[1/(# instances in class 0), 1/(#instances in class 1) , … , 1/(# instances in class n)]
Do you see drawbacks to this approach other than slower learning? The other approach is to do the following:
p_i = (#instances in class i)/(# total samples in set)
p_i’ = 1- p_i
Then the vector would be:
[p_0’, p_1’, …, p_n’ ]