BloodAxe / pytorch-toolbelt

PyTorch extensions for fast R&D prototyping and Kaggle farming
MIT License
1.52k stars 122 forks source link

FocalLoss #78

Closed mehran66 closed 2 years ago

mehran66 commented 2 years ago

🐛 Bug

There are two types of focal loss here (BinaryFocalLoss and FocalLoss): https://github.com/BloodAxe/pytorch-toolbelt/blob/develop/pytorch_toolbelt/losses/focal.py

Both of these functions are calling the focal_loss_with_logits function, while the second one should use softmax_focal_loss_with_logits.

BloodAxe commented 2 years ago

Thanks for the tip, it is fixed now in 0.5.3 release.