8000 Weight Decay gradient question · Issue #18 · szymonmaszke/torchlayers · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Weight Decay gradient question #18

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

Open
kogolobo opened this issue Apr 22, 2025 · 0 comments
Open

Weight Decay gradient question #18

kogolobo opened this issue Apr 22, 2025 · 0 comments

Comments

@kogolobo
Copy link

In WeightDecay regularization class, the code replaces the parameter's gradient with the gradient of the regularization:

param.grad = self.regularize(param)

Should it instead add the regularization gradient to the existing parameter gradient? i.e.:

param.grad.add_(self.regularize(param))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0