Weight and bias initilization


The requirement is :
create initialization(w0,b0)<–init()
i need to use the same weight for online model and global model at first epoch and need to do self update of weight and bias…
I have done following but its not working…please support me …

I have done the initilization by following code,

def init_normal(m):
    if type(m) == nn.Linear:
        if m.bias is not None:
            nn.init.constant_(m.bias.data, 0.001)

Now i want to initilize weight and bias generated by the above function.i had traied with


when i call the model1,the weight and bias is not updated…

To use the init_normal function, you would have to use it via model.apply(init_normal).
I’m unsure what the real use case is and what exactly is not working, so could you explain the use case and problems a bit more?