Skip to content
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

Spectral Norm Features #810

Open
lockwo opened this issue Aug 22, 2024 · 1 comment
Open

Spectral Norm Features #810

lockwo opened this issue Aug 22, 2024 · 1 comment
Labels
feature New feature

Comments

@lockwo
Copy link
Contributor

lockwo commented Aug 22, 2024

The original spectral norm paper didn't accurately estimate spectral norms (e.g. in the convolution case they just reshape it then do normal matrix, but this isn't the actual transpose operation, see: https://arxiv.org/abs/2009.02773 for more) which is now the general default in neural network packages (equinox included). However, it's not that much LoC to get a spectral norm that can do one or both of the following (sources: https://arxiv.org/abs/1804.04368, https://arxiv.org/abs/1811.07457)

  • actually approximates the correct spectral norm (and thus adheres to the 1-lipshitz cap, which original SN isn't super great at, see fig 3 of https://arxiv.org/abs/1802.04034). This basically just replaces the reshaping -> transpose, with the actual linear transpose operation of a given layer
  • can be made numerically meaningful (by guaranteeing convergence to a certain threshold), at the cost of only being forward differentiable

I have some code that does both of these things that I could polish enough for equinox to really boost the spectral norm flexibility (of course keeping all existing features, these are valuable in research, but in actual performance doing a poor approximation to a spectral norm actually often performs better than the real norm lol see sec 4 of http://www.arxiv.org/abs/2009.02773). But I wanted to check if there was any interest/scope for these sort of enhancements/expansions.

@patrick-kidger
Copy link
Owner

Definitely in-scope! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants