-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Call optimizer.zero_grad()
before backward inside closure in AutoOpt
#6147
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
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
a6da028
Call zero_grad inside closure
akihironitta 57840f9
Call zero_grad inside closure independently of optim
akihironitta 8d1253d
Remove optimizer.zero_grad from optimizer.step
akihironitta eaf42fd
Use accelerator's zero_grad
akihironitta 00376fc
Update manual optimization docs
akihironitta be43077
Update automatic optimization docs
akihironitta 77d7f83
Merge branch 'master' into bugfix/4083_lbfgs
akihironitta 3f6e086
Update new-project docs
akihironitta c422ffa
Move on_before_zero_grad to trainloop
akihironitta 95e0a0b
Use trainerloop methods
akihironitta e852efd
Merge branch 'bugfix/4083_lbfgs' of github.com:akihironitta/pytorch-l…
akihironitta 8243b80
Remove zero_grad after backward
akihironitta 8269f45
Split tests to step and zero_grad
akihironitta 4694e3e
Call zero_grad before backward in tests
akihironitta d658920
Call zero_grad before backward in tests
akihironitta 2dd6154
Add a test for optimization with lbfgs
akihironitta 2fe4d28
Remove unused model
akihironitta 1845a67
Add back BoringModel
akihironitta eb875b4
Update CHANGELOG
akihironitta d898e7b
zero_grad when the first batch of accumulation
akihironitta d262546
Merge branch 'master' into bugfix/4083_lbfgs
akihironitta 435a3c8
Refactor tests. Remove duplicates
carmocca 22fd399
Add a test to check zero_grad call order
akihironitta 02ec3aa
flake8
akihironitta f92f708
Update test comment
akihironitta 85431ff
Make test compatible with PT1.4
akihironitta 1be883e
Apply suggestions from code review
akihironitta 337d85b
Use simple string for logging called methods
akihironitta 3194bb3
Add optimzer.step to test
akihironitta 1b5c1ce
Merge branch 'master' into bugfix/4083_lbfgs
akihironitta 91e7ae1
Update the test comment
akihironitta 96a5504
Update the test
akihironitta 87fdfb8
Update the test
akihironitta 9d11f34
Remove unused import
akihironitta 93d3f57
Update test comment
akihironitta 05c28d5
Update CHANGELOG.md
akihironitta 9836bb7
Update docs
akihironitta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.