jiawei-ren / BalancedMetaSoftmax-Classification

[NeurIPS 2020] Balanced Meta-Softmax for Long-Tailed Visual Recognition
https://github.com/jiawei-ren/BalancedMetaSoftmax
Other
135 stars 26 forks source link

Specifying the class frequencies #16

Open dtafler opened 7 months ago

dtafler commented 7 months ago

Hi,

thank you for the inspired paper and for uploading your code.

Maybe I am overlooking it, but I cannot find the files specifying the class frequencies for the balanced softmax loss. The path to the file is specified in the config:

https://github.com/jiawei-ren/BalancedMetaSoftmax-Classification/blob/34a61e432881816c2da14d577d6ed63501288f5f/config/CIFAR100_LT/balanced_softmax_imba200.yaml#L6C32-L6C32

and used in the balanced softmax loss function to get the class frequencies:

https://github.com/jiawei-ren/BalancedMetaSoftmax-Classification/blob/34a61e432881816c2da14d577d6ed63501288f5f/loss/BalancedSoftmaxLoss.py#L26-L29

Am I correct in assuming that the file simply contains the class frequencies and, once converted to a torch tensor, that the indices of that tensor correspond to the class labels?

jiawei-ren commented 7 months ago

Yes, that's right.