Standardize weight_decay_mask naming and add weight decay#1635
Open
rdyro wants to merge 2 commits intogoogle-deepmind:mainfrom
Open
Standardize weight_decay_mask naming and add weight decay#1635rdyro wants to merge 2 commits intogoogle-deepmind:mainfrom
rdyro wants to merge 2 commits intogoogle-deepmind:mainfrom
Conversation
…ight decay to optimizers Addresses inconsistencies where the mask parameter for weight decay was named `mask` instead of `weight_decay_mask` in optimizers like adamw, nadamw, adan, lion, lamb, and adamaxw. Additionally, missing decoupled weight decay support (with `weight_decay` and `weight_decay_mask`) was added to multiple base optimizers including adabelief, adagrad, amsgrad, radam, rmsprop, sgd, sm3, yogi, optimistic_gradient_descent, optimistic_adam, and optimistic_adam_v2. The novograd alias continues to use its internal decoupled approach.
670f1d3 to
6ed973a
Compare
…param requirements
988573e to
4cf37de
Compare
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.
Test PR co-written with Gemini.
Addresses inconsistencies where the mask parameter for weight decay was named
maskinstead ofweight_decay_maskin optimizers like adamw, nadamw, adan, lion, lamb, and adamaxw. Additionally, missing decoupled weight decay support (withweight_decayandweight_decay_mask) was added to multiple base optimizers including adabelief, adagrad, amsgrad, radam, rmsprop, sgd, sm3, yogi, optimistic_gradient_descent, optimistic_adam, and optimistic_adam_v2. The novograd alias continues to use its internal decoupled approach.Optimizers With Weight Decay
Historically designed with decoupled weight decay explicitly:
adamwnadamwadamaxwAlready have weight decay added:
adanlionlambadadeltaadafactor(namedweight_decay_rate)Newly updated to standard decoupled weight decay:
adabeliefadagradamsgradradamrmspropsgdsm3yogioptimistic_gradient_descentoptimistic_adamoptimistic_adam_v2Applying weight decay inside their specific transformation:
novogradlarsOptimizers Without Weight Decay
Left without weight decay to serve as unmodified algorithms:
Kept for backward compatibility to match their "W" counterparts natively.
adamnadamadamaxModifies gradient signs (norm agnostic):
Weight decay could behave unpredictably since gradient magnitude is ignored.
sign_sgdsignumNiche algorithms or raw-gradient wrappers:
Weight decay is not a standard practice for these methods.
noisy_sgdrproppolyak_sgdlbfgsfromage