vandit15 / Class-balanced-loss-pytorch

Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"
MIT License
784 stars 120 forks source link

fix bug in call to BCEwithlogits #13

Open aalok-sathe opened 4 years ago

aalok-sathe commented 4 years ago

the keyword had a typo: 'weight' instead of 'weights'. in case weights requires grads, it needs to be detached first as BCEwithlogits is not implemented for grad tracked tensor