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

Remove gradient calculation during inference #258

Merged
merged 6 commits into from
Oct 24, 2023
Merged

Conversation

melihyilmaz
Copy link
Collaborator

@melihyilmaz melihyilmaz commented Oct 24, 2023

This was a workaround to avoid NaN outputs. With PyTorch 2.10, the workaround is no longer necessary and local tests with a setup that produces NaNs with older versions of PyTorch work correctly.

Changes include:

  • Removed gradient calculation in validation_step() and predict_step()
  • Upgraded to PyTorch >= 2.1

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #258 (b52fcfa) into dev (3a18fed) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head b52fcfa differs from pull request most recent head 74ba255. Consider uploading reports for the commit 74ba255 to get more accurate results

@@            Coverage Diff             @@
##              dev     #258      +/-   ##
==========================================
- Coverage   89.24%   89.22%   -0.03%     
==========================================
  Files          12       12              
  Lines         902      900       -2     
==========================================
- Hits          805      803       -2     
  Misses         97       97              
Files Coverage Δ
casanovo/denovo/model.py 97.43% <100.00%> (-0.02%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bittremieux bittremieux merged commit 7721962 into dev Oct 24, 2023
4 checks passed
@bittremieux bittremieux deleted the remove-grad-workaround branch October 24, 2023 08:12
melihyilmaz added a commit that referenced this pull request Nov 2, 2023
* Remove unused custom_encoder option (#254)

* resolves issue #238: remove custom_encoder option

* fixed lint issue

* fixed lint issue

* Revert "fixed lint issue"

This reverts commit bd1366c.

* lint

* lint issue

* Consistently format changelog.

---------

Co-authored-by: Isha Gokhale <[email protected]>
Co-authored-by: Wout Bittremieux <[email protected]>

* Correctly report AA precision and recall during validation (#253)

Fixes #252.

Co-authored-by: Melih Yilmaz <[email protected]>

* Remove gradient calculation during inference  (#258)

* Remove force_grad in inference

* Upgrade required PyTorch version

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fix typo in torch version

* Specify correct Pytorch version change

---------

Co-authored-by: Wout Bittremieux <[email protected]>

* Add label smoothing

* Modify config file

* Minor fix config.yaml

* Run black

* Lint casanovo.py

---------

Co-authored-by: ishagokhale <[email protected]>
Co-authored-by: Isha Gokhale <[email protected]>
Co-authored-by: Wout Bittremieux <[email protected]>
Co-authored-by: Wout Bittremieux <[email protected]>
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.

2 participants