I have an instance of a class that I want to save in a different variable, so that I can make changes to the original without the state stored in the other variable being affected.
However, any changes I make to the original object (nn) is replicated in the second object (nn_2).
Code:
nn_2 = nn
nn_2.LEARNING_RATE = 3
nn.LEARNING_RATE = 1
print(nn_2.LEARNING_RATE)
print(nn.LEARNING_RATE)
Output:
1
1
What would be the way of achieving this?
Thanks,