# How to introduce the manual weight and bias?

**URL:** <https://discuss.pytorch.org/t/how-to-introduce-the-manual-weight-and-bias/127269>\
**Category:** Uncategorized\
**Created:** [July 20, 2021, 5:36pm UTC](https://discuss.pytorch.org/t/how-to-introduce-the-manual-weight-and-bias/127269 "2021-07-20T17:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pramesh](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/p/848f3c/32.png) [@pramesh](https://discuss.pytorch.org/u/pramesh)\
**Post date:** [July 20, 2021, 5:36pm UTC](https://discuss.pytorch.org/t/how-to-introduce-the-manual-weight-and-bias/127269/1 "2021-07-20T17:36:08Z")

</div>

I want to use the same weight and bias for the two model respectively at 1st epoch and need to be updated accordingly.

```auto
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

```auto
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
