vandit15 / Class-balanced-loss-pytorch

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

Reduction for the Cross Entropy #1

Closed inspirit closed 5 years ago

inspirit commented 5 years ago

thank you for sharing Pytorch implementation, I was wondering if we need to specify "reduction="none"" for the "binary_cross_entropy_with_logits" function here since we are going to do weighting and reduction on our own later? https://github.com/vandit15/Class-balanced-loss-pytorch/blob/fb634a6e42ecaa2e3d7e974cd124180c679da6c7/class_balanced_loss.py#L35

vandit15 commented 5 years ago

Thanks for pointing out. Made necessary changes