-
-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add namedparams #1144
base: master
Are you sure you want to change the base?
add namedparams #1144
Conversation
Tests will also be necessary here. |
Also, if the parameter has no name, does it make sense to return |
Do you mean we should filter out parameters without names? |
Shouldn't the pairs be Also, what is the motivation behind using this more generally? |
@dhairyagandhi96 namedparams is useful when you want to add penalties only for weights but not biases. |
Yes, layer information should be added. |
Tests and docs are added. Incorporating layer information is hard in the current setting of |
Any idea? |
I think this would be better served by taking gradients WRT the model directly, which will give you back a struct of the same shape. In general we've been trying to move away from the bag of params approach to leverage functors more, so IMO the effort is better spent there. |
there are some use cases for this for model inspection, but the pairing should be cf #1444 as slightly related |
I understand the use case for this, and I think it is natural syntax coming from other languages. But I feel that the best way to write code that would use I agree with @ToucheSir's point and would add that it would be better to explain in the docs how to do such things. Like a "mapping function over parameters" tutorial. |
AIUI this would require some additional infrastructure to work as an input to |
Upon revisiting this, I think it would be nice to have a function that returns structured model parameters as a (named)tuple, much like what |
The suggestion by @ChrisRackauckas in #1613 to use |
I'm not sure Functors should be in the business of knowing what a ComponentArray is, but perhaps Flux could thread everything together if the dependency isn't too onerous. I could see it being quite compelling for |
Yeah, this would be Flux using Functors + ComponentArrays to provide something equivalent to |
No description provided.