ENH Adds label_smoothing to cross entropy loss#63122
ENH Adds label_smoothing to cross entropy loss#63122thomasjpfan wants to merge 43 commits intopytorch:masterfrom
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. |
jbschlosser
left a comment
There was a problem hiding this comment.
Thanks for tackling this! Added some comments below. To summarize:
- I think we want the end result to handle both
ignore_indexand class prob targets - Can the implementation be simplified by doing label smoothing as additional math outside of the call to
at::nll_loss_ndand doing a linear combination?
|
@jbschlosser 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. |
|
@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