I have a strange behavior with a variable in the following code.
Why is the output of w3 at the end the same as w2? Its never been changed in the code, but in the end it has the same value as w2?
import numpy as np
inpt = np.array([[1]])
w1 = np.random.random((1,1))
w2 = np.random.random((1,1))
w3 = w2
print("First w3: ", w3)
n1 = np.dot(inpt, w1)
n2 = np.dot(n1, w2)
delta = 1 - n2
n1_d = np.dot(delta, w2.T)
w2 += np.dot(n1.T, delta)
w1 += np.dot(inpt.T, n1_d)
print("Second w3: ", w3)
print("Value of w2: ", w2)
First w3: [[ 0.98377014]]
Second w3: [[ 1.01105407]]
Value of w2: [[ 1.01105407]]
What am I doing wrong here?