Repository navigation
Run AdaBound on the real and imaginary parts - #555
Open
shaneraphel wants to merge 1 commit into
Open
shaneraphel wants to merge 1 commit into
shaneraphel wants to merge 1 commit into
Conversation
clamp is not implemented for complex tensors, so a complex weight raised NotImplementedError at the learning-rate bound (issue 458). The bound is applied to a real view of the parameter, the same way Adam updates a complex weight: both components are kept and the real parameter path is unchanged.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #458 for AdaBound.
step_size.clamp_is not implemented for complex tensors, so a complex weight raisedNotImplementedError: clamp is not supported for complex typesat the learning-rate bound and never updated.A complex parameter is updated as two real components. The moments, the bound and the write-back run on
torch.view_as_real, which is how Adam updates a complex weight: both the real and the imaginary part are kept, and neither is dropped. Real parameters take the same statements as before.Adahessian's complex failure in the same issue is a different call (
torch.randint_likeon a complex tensor) and is not changed here.Test plan
pytest tests/test_adabound_complex.py0.09872793406248093on the first coordinate.view_as_realof the same parameter and gradient, bitwise.