Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loss Functions for Common Tasks #251

Open
8 tasks
oke-aditya opened this issue Sep 25, 2020 · 2 comments
Open
8 tasks

Loss Functions for Common Tasks #251

oke-aditya opened this issue Sep 25, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@oke-aditya
Copy link
Contributor

oke-aditya commented Sep 25, 2020

🚀 Feature

Frequently re-used losses that can be added to bolts.

Motivation

Writing Losses is quite repetitive. PyTorch supports losses which are written with deep interoperability with C++ API. But most research losses aren't. Can these go to bolts/lightning (I feel it won't be good in lightning and better in bolts).

These losses are building blocks for other complicates losses as well.

Pitch

A non-exhaustive and probable list of losses that are not PyTorch but used often.

  • gIoU loss -> Used in Detr (will make porting Detr easier, present in fvcore
  • focal loss -> Used in RetinaNet (It will come in torchvision as well but we we can have here too for re-use, present in fvcore
  • smooth l1 loss -> Used in FRCNN and RetinaNet (In torchvision here and torch but might be helpful)
  • Jsd loss -> Used alternative to CrossEntropy in Classification here
  • Varients of Cross Entropy -> Unsure if they are used often found them here
  • Dice Loss -> Used in U-Net and other segmentation models.
  • Sigmoid Focal Loss -> Modification of Focal loss for segmentation.
  • Huber loss -> Used in efficnet Det and similar loss. Implemented here

Unsure of losses in audio and text domains. Someone can add them here as well.

Alternatives

Wait for them to reach into fvcore or PyTorch. Till then we keep duplicating these code for models.

Additional context

I might be able to add PRs for these. These look migrations from repositories such as fvcore, etc. I will cite them as their implementations are used.
I think that these are likely to be adapted from sources, so unsure of licensing and other policies.

cc @Borda @nateraw

@oke-aditya oke-aditya added enhancement New feature or request help wanted Extra attention is needed labels Sep 25, 2020
@rohitgr7
Copy link
Contributor

I'll try to complete focal loss and smoothing loss this week #121

@Cuberick-Orion
Copy link

Triplet Loss and its variants can be helpful for metric learning. In case anyone is interested I can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants