Hi, I have a question which confused me a lot.
I want to normalize the network parameters in every forward time, how should i do?
import torch
import torch.nn as nn
class mynet(nn.Module):
     def __init__():
          self.conv1 = nn.Conv2d(128,128,3,1,1)
     def forward(input):
          self.conv1.weight /=torch.norm(self.conv1.weight, p=2, 1,keepdim=True)
          output = self.conv1(input)
     return output

I think i should do like this, but i am not sure about it. Please help me. Thanks