What are the differences between numpy.random.rand
and numpy.random.randn
?
From the documentation, I know the only difference between them is the probabilistic distribution each number is drawn from, but the overall structure (dimension) and data type used (float) is the same. I have a hard time debugging a neural network because of this.
Specifically, I am trying to re-implement the Neural Network provided in the Neural Network and Deep Learning book by Michael Nielson. The original code can be found here. My implementation was the same as the original; however, I instead defined and initialized weights and biases with numpy.random.rand
in the init
function, rather than the numpy.random.randn
function as shown in the original.
However, my code that uses random.rand
to initialize weights and biases
does not work. The network won't learn and the weights and biases will not change.
What is the difference(s) between the two random functions that cause this weirdness?