-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Max norm regularisation #541
Comments
Why not just add norm clipping function to a vector of optimizers? |
This does seem like it should be part of the optimiser in some way, but it's not obvious how to express it. One thing worth considering vs Keras is that this should be something that composes with existing layers (as opposed to a similar-looking but independent API added to each layer). |
The parameter regularization (part of the loss) that depends only on model parameters but not data is already quite easy to write. I can't think of any concise regularizer API that wouldn't be sacrificing flexibility or readability. # l2 regularization of dense layer
loss = ... + λ₁ * colnorm(dense_layer.W) + λ₂ * norm(dense_layer.b)
# soft parameter sharing
loss = ... + λ * norm(layer1.W - layer2.W) The Max norm and other parameter constraints are different because they mutate parameters after Something like: |
Yes, that's a nice separation of the issues. I could imagine having some kind of sugar for very common forms of regularisation, but we don't need to worry about that here. One way to express constraints would be something like Things are weird partly because callbacks are a strict generalisation of optimisers, yet we have both. I'd like to eventually expose that relationship explicitly but I'm not sure how to do it neatly yet. |
Since #1133 this should no longer be an issue. |
Perhaps each layer could take a constraint so something like max norm regularization
||w|| < c
would be simple to add to a layer (or all layers in a model?).How it is done in Keras:
https://github.com/keras-team/keras/blob/1d81a20292ca6926e595d06a6cd725dbb104a146/keras/constraints.py#L51-L55
The text was updated successfully, but these errors were encountered: