I have a linear layer which is nn.Linear(2000,50,bias=False). The weight matrix is 50x2000. I want to constrict each column of the weight matrix sum to 1. Specifically, w + w + … + w = 1. How can I do this in pytorch ?
Did you try this?
Thank you. At first, I did not understand the answer in it. But now I get it.