patrick-kidger / equinox

Elegant easy-to-use neural networks + scientific computing in JAX. https://docs.kidger.site/equinox/
Apache License 2.0
2.09k stars 139 forks source link

Spectral Norm Features #810

Open lockwo opened 2 months ago

lockwo commented 2 months ago

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)

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 commented 2 months ago

Definitely in-scope! :)