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

Label smoothing in training #261

Merged
merged 13 commits into from
Dec 12, 2023
Merged

Label smoothing in training #261

merged 13 commits into from
Dec 12, 2023

Conversation

melihyilmaz
Copy link
Collaborator

After encountering the NaN outputs from the model half way through training in a few runs, I experimented with minimal label smoothing when calculating the training loss as a mitigation strategy. I was able redo the same training runs with the same setup significantly longer without encountering NaNs and with similar performance metrics compared to the original runs.

Loss calculation is only impacted by smoothing during training steps, i.e. not validation, and I tentatively added the minimal label smoothing factor as the default option.

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (235420f) 89.43% compared to head (5e58b65) 89.47%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #261      +/-   ##
==========================================
+ Coverage   89.43%   89.47%   +0.03%     
==========================================
  Files          12       12              
  Lines         909      912       +3     
==========================================
+ Hits          813      816       +3     
  Misses         96       96              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@melihyilmaz melihyilmaz requested a review from wfondrie November 1, 2023 22:03
Copy link
Collaborator

@wfondrie wfondrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me aside from needing a unit test.

casanovo/denovo/model_runner.py Outdated Show resolved Hide resolved
@melihyilmaz melihyilmaz requested a review from wfondrie November 28, 2023 01:00
Copy link
Collaborator

@wfondrie wfondrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@bittremieux bittremieux merged commit 3b688e8 into dev Dec 12, 2023
6 checks passed
@bittremieux bittremieux deleted the label-smoothing branch December 12, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants