has anyone implemented spectral normalization(https://openreview.net/forum?id=B1QRgziT- 40) using pytorch.  In the original paper, they propose spectral normalization on the weights of GAN, and achieve good results. The training algorithm is below:

image.png899×404 49.2 KB

Is there a simple way to compute spectral norm  of the weights Wsn? I note that one naive way is to  fetch the parameters of a module out  and do further processing, or just wrap the module in a forward hooks (i doubt it is okay when doing backward propagation)? can anyone give some help?