Enhance SGDP optimizer with caution parameter#2675
Merged
rwightman merged 5 commits intohuggingface:mainfrom Mar 5, 2026
Merged
Enhance SGDP optimizer with caution parameter#2675rwightman merged 5 commits intohuggingface:mainfrom
rwightman merged 5 commits intohuggingface:mainfrom
Conversation
Added 'caution' parameter to SGDP optimizer for enhanced functionality.
Fix reference link for Spherical Cautious Optimizers
Clone the buffer before using it for the update.
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.
Hi Ross, long time no see!
I have completed the implementation to add the cautious mask to the SGDP optimizer. The specific updates in this PR are as follows:
csgdp: I implemented the cautious mask forsgdpfollowing the exact same logic used incadamp.csgdpin the optimizer factory.csgdpandcsgdw.I have run the tests locally. Specifically for the Rosenbrock function, the output is as follows:
The tests passed successfully. To verify that the training workflow completes without issues, I also ran the following scripts:
and
Here are the respective results:
CSGDP:
CSGDW:
These preliminary results demonstrate that ‘csgdp‘ can run successfully and maintain stable convergence.
Looking forward to your review when you have some free time!