# How am I supposed to apply spectral norm in my model?

**URL:** <https://discuss.pytorch.org/t/how-am-i-supposed-to-apply-spectral-norm-in-my-model/159269>\
**Category:** Uncategorized\
**Created:** [August 16, 2022, 12:25am UTC](https://discuss.pytorch.org/t/how-am-i-supposed-to-apply-spectral-norm-in-my-model/159269 "2022-08-16T00:25:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Legend](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/andrew_legend/32/50064_2.png) [@Andrew\_Legend](https://discuss.pytorch.org/u/Andrew_Legend)\
**Post date:** [August 16, 2022, 12:25am UTC](https://discuss.pytorch.org/t/how-am-i-supposed-to-apply-spectral-norm-in-my-model/159269/1 "2022-08-16T00:25:02Z")

</div>

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

```auto
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.
