-
-
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
filtering a subset of parameters #939
Comments
Sorry, miss-click |
You should be able to use |
Thanks for the reply. This relates to #160, and I accidentally hit Ctrl-Enter way before I wanted. The params returned by function weight_params(m::Chain, ps=Flux.Params())
map((l)->weight_params(l, ps), m.layers)
ps
end
weight_params(m::Dense, ps=Flux.Params()) = push!(ps, m.W)
weight_params(m::Conv, ps=Flux.Params()) = push!(ps, m.weight)
weight_params(m::ConvTranspose, ps=Flux.Params()) = push!(ps, m.weight)
weight_params(m, ps=Flux.Params()) = ps
|
1444: define modules function r=CarloLucibello a=CarloLucibello A function returning an iterator over non-leaf parameters. Mainly motivated by the need to apply L2 regularization to weights only (see #1284 , #939), but may be of more general use. Fix #1294, Fix #1284 ### PR Checklist - [ ] Tests are added - [ ] Entry in NEWS.md - [x] Documentation, if applicable - [ ] Final review from `@dhairyagandhi96` (for API changes). Co-authored-by: Carlo Lucibello <carlo.lucibello@gmail.com> Co-authored-by: Carlo Lucibello <carlo.lucibello@unibocconi.it>
Hi, a related question, is it possible to filter a subset of parameters? The use case is to apply L2 decay on weights but not bias.
The text was updated successfully, but these errors were encountered: