I am not sure if I apply spectral norm in my model properly.
More specifically I am applying it like this with the parametrization module
class TestModel(nn.Module):
def __init__(self):
super(TestModel, self).__init__()
self.input_conv= nn.utils.parametrizations.spectral_norm(nn.Conv2d(3, 64, 5, padding=2), n_power_iterations=5)
self.i_activation= nn.LeakyReLU()
self.downconv1= nn.utils.parametrizations.spectral_norm(nn.Conv2d(64, 64, 3, padding=1), n_power_iterations=5)
self.d_activation1= nn.LeakyReLU()
def forward(self, x):
x= self.input_conv(x)
x= self.i_activation(x)
x= self.downconv1(x)
x= self.d_activation1(x)
return x
But my critic appears to train like spectral norm does not exist at all. I have done a lot of debugging to see what is going on. So what I am not (yet) sure is if I am doing this properly or not.