EthanRosenthal / spacecutter

Ordinal regression models in PyTorch
https://www.ethanrosenthal.com/2018/12/06/spacecutter-ordinal-regression/
MIT License
137 stars 16 forks source link

Class weights should be normalized #16

Open IDoCodingStuffs opened 2 months ago

IDoCodingStuffs commented 2 months ago

Currently per-class weights are simply multiplied with the raw NLL loss, which skews the effective learning rate. They should be normalized by sum by default to avoid this:

https://discuss.pytorch.org/t/the-value-of-weights-for-weighted-cross-entropy-should-be-normalized/190727