-
Notifications
You must be signed in to change notification settings - Fork 22.3k
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
ENH Adds label_smoothing to cross entropy loss #63122
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 1a41ce5 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this! Added some comments below. To summarize:
- I think we want the end result to handle both
ignore_index
and class prob targets - Can the implementation be simplified by doing label smoothing as additional math outside of the call to
at::nll_loss_nd
and doing a linear combination?
@jbschlosser has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@datumbox has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@datumbox has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@jbschlosser has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Codecov Report
@@ Coverage Diff @@
## master #63122 +/- ##
=======================================
Coverage 66.73% 66.74%
=======================================
Files 698 698
Lines 90892 90922 +30
=======================================
+ Hits 60661 60690 +29
- Misses 30231 30232 +1 |
@jbschlosser merged this pull request in d3bcba5. |
Summary: Adds awareness of the new `label_smoothing` functionality in `cross_entropy` added in pytorch/pytorch#63122 to nestedtensor's implementation. Fixes broken test: `test.test_nested_tensor_functional.TestFunctional`. Differential Revision: D30730728 fbshipit-source-id: 34d907b76a1d2058cc7bc7d12c271cc3088a351b
Summary: Pull Request resolved: #452 Adds awareness of the new `label_smoothing` functionality in `cross_entropy` added in pytorch/pytorch#63122 to nestedtensor's implementation. Fixes broken test: `test.test_nested_tensor_functional.TestFunctional`. Reviewed By: cpuhrsch Differential Revision: D30730728 fbshipit-source-id: 04f146d6de7f764f165059e4b5654d7f39142e38
Fixes #7455
Partially resolves pytorch/vision#4281
cc @albanD @mruberry @jbschlosser