Class-balanced-loss-pytorch
Class-balanced-loss-pytorch copied to clipboard
why is no_of_classes needed for weights normialisation
Hi @vandit15,
Thanks for sharing your code.
In line 73, weights = weights / np.sum(weights) * no_of_classes
, why is no_of_classes included here to normalise the weights? Any help would be thankful.
Thanks
I have the same question. Do you have resolved it?
It is not needed, @m-zheng @Wangbenzhi refer to https://github.com/fcakyon/balanced-loss for improved and maintained version
The article in Section 4 has mentioned that. They normalize the sum of \alpha to C, whicH C is the total number of classes