How do I repeat same results by using the same parameters and sample when training neural network (like BP) in MATLAB? For example, I want to compare the effects of different nodes of hidden layer on neural network training. But even if I set the same initial weights and bias, same sample and nodes the trained neural network capabilities are still different each time. What causes the phenomena? Is the algorithm inherently random (e.g. gradient descent)?
This is my code.W1 W2 B1 B2 is unchanged。
net = feedforwardnet(S1);
net.InputWeights{1}.userdata=W1;
net.biases {1} .userdata=B1;
net.layerWeights{1}.userdata=W2;
net.biases {2} .userdata=B2;
view(net);
[net,tr]= train(net,P,T);
Thank you!