I want to use the same weight and bias for the two model respectively at 1st epoch and need to be updated accordingly.
def init_normal(m):
if type(m) == nn.Linear:
nn.init.kaiming_uniform_(m.weight)
if m.bias is not None:
nn.init.constant_(m.bias.data, 0.001)
model = MLP(INPUT_DIM, OUTPUT_DIM)
model=model.apply(init_normal)
As i am doing the iteration ,the weight and bias is updated .And affecting the overall accuracy of the next model.
I tried the following peice of code
model1=copy.deepcopy(model)
this is working fine for first epoch but at the second epoch it is using the same weight and bias.
I want to use the updated one at the second epoch.
Any reference code will be highly appriciated…
I am new to pytorch…please support…
thanks with best regards,
pramesh