In the init method, can I do something like
self.input = nn.Linear(28 * 28, 28 * 28, requires_gradients=False)
or is it not they way it should be done?
In the init method, can I do something like
self.input = nn.Linear(28 * 28, 28 * 28, requires_gradients=False)
or is it not they way it should be done?
maybe u can do this way
self.input = nn.Linear(28*28, 28*28)
self.input.weight.data.requires_grad=False
self.input.bias.data.requires_grad=False
That looks like it should work. Is there a reason why you wrote the second line twice?
I make a mistake, the second line should be bias if u use default parameter in nn.Linear