-
Notifications
You must be signed in to change notification settings - Fork 10
Normalized Riemannian optimizer #36
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
Conversation
skyw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't finished reviewing all the tests. Will do another path when requested changes are done.
emerging_optimizers/riemannian_optimizers/normalized_optimizer.py
Outdated
Show resolved
Hide resolved
emerging_optimizers/riemannian_optimizers/normalized_optimizer.py
Outdated
Show resolved
Hide resolved
emerging_optimizers/riemannian_optimizers/normalized_optimizer.py
Outdated
Show resolved
Hide resolved
2f8543f to
dd2194d
Compare
skyw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of left overs need further fix, parameter for example.
I didn't check convergence test very carefully. Also L1 tests haven't been set up in CI, post a local run result in the chat before final approval.
Here are results of convergence test: Running tests under Python 3.12.8: /Users/mkhona/miniconda3/envs/pytorch_env/bin/python |
b9a92ce to
25c7835
Compare
|
/ok to test 25c7835 |
25c7835 to
a9f16b0
Compare
|
/ok to test f87162d |
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
c4db61a to
6eab498
Compare
|
/ok to test 6eab498 |
Signed-off-by: mikail <[email protected]>
skyw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rerun test after addressing last a few comment, plz.
tests/test_normalized_optimizer.py
Outdated
| # Set seed for CUDA if available | ||
| if torch.cuda.is_available(): | ||
| torch.cuda.manual_seed_all(1234) | ||
| self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't auto select device, especially in test. If the test is accidently assigned to a machine without GPU, it can end up never being tested on GPU. Same for other test cases.
Signed-off-by: mikail <[email protected]>
Signed-off-by: mikail <[email protected]>
|
/ok to test f97ef77 |
* added normalized optimizers and fixed docstrings and formatting Signed-off-by: mikail <[email protected]>
* added normalized optimizers and fixed docstrings and formatting Signed-off-by: mikail <[email protected]>
Added an optimizer for normalized weights, i.e. weights whose columns or rows sum to 1. This is referred to as the "Oblique manifold" and this optimizer performs Riemannian descent on the oblique manifold (see An Introduction to Optimization on Smooth Manifolds by Nicolas Boumal at https://www.nicolasboumal.net/book/ for details)