-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add exact spectral norm feature #831
base: main
Are you sure you want to change the base?
Conversation
Open to discussion on best interface. The current caution around bias is ok but could be a footgun (although the original paper doing the reshaping is already kind of a footgun imo lol), but maybe I can apply the linear transpose around the whole layer pytree and update the bias too? I'm not sure that would 100% generalize to all layers though. |
!!! Caution | ||
|
||
If `exact` is true, it computes the transpose via `jax.linear_transpose` of | ||
the layer. This includes all operations of the layer call, which means for | ||
layers with a bias, this can result in the incorrect spectral value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should follow JAX's lead here and transpose the tangent pass of jax.jvp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I tried to implemented what I thought you meant. This also means we could remove the "weight" flag for the exact case (maybe?) since we basically "determine" the weight through the jvp?
Let me know if this is what you had in mind, or if I was totally off. Does seem like a lot of jvps tho.
Addresses part of #810.