-
Notifications
You must be signed in to change notification settings - Fork 204
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
Masking certain parameters for weight decay in adamw #1007
Comments
Hello @AakashKumarNain This was raised in #913 and @JadM133 found a solution. PR #1015 should fix this. |
Thanks @vroulet for pointing out the PR. I hope it gets merged soon because this has been a huge blocker for the Equinox users. Also, do you have any immediate suggestion to make it work for now? |
Hello @AakashKumarNain , in the meantime, you can modify two lines in _src/wrappers.py: Line 544: mask_tree = mask (instead of "mask(params) if callable(mask) else mask") This should get your code to run as expected until the pull request is merged. |
Thanks @JadM133 for the suggestion. I will try it out |
The PR has been merged. You'll need to install optax locally to use it (we may not release a new version soon). |
Thank you. I will do a local install |
Hello @AakashKumarNain Could you send the exact bug and a minimal reproducing example?
|
Hello @vroulet , @AakashKumarNain , I think the issue is not with the mask. I assume @AakashKumarNain is getting the following error:
The problem is that the update function of adamw is different than the others and requires param (as mentioned in the documentation). So to use adamw, using the same code as adam is changing the name of the optimizer won't work. Some changes should be done to the code as the one written by @vroulet above. |
I have a model built in Equinox, and I want to filter out parameters in a way that weight decay is applied only a certain subset of the original Pytree. But it seems that optax has a problem with pytrees passed as mask. Here is a MWE:
Traceback
You can find the related discussion: patrick-kidger/equinox#771
The text was updated successfully, but these errors were encountered: