I would like to fix the initial weights for the neural network I created. Currently, I have initialized the weights as given below.
Is there a way by which can I initialize one set of fixed random weights? so that every time I run the code the initialized array is the same.
def InitializeWeights(nodes):
layers, weights = len(nodes), []
for i in range(1, layers):
w = [[np.random.uniform(-1, 1) #randomise weights
for k in range(nodes[i-1] + 1)]
for j in range(nodes[i])]
weights.append(np.matrix(w))
return weights
question from:https://stackoverflow.com/questions/66045303/how-to-initialise-fixed-weights