title: Differences between numpy.random.rand vs numpy.random.randn in Python
body: <p>What are the differences between <code>numpy.random.rand</code> and <code>numpy.random.randn</code>?</p>
  <p>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.</p>
  <p>Specifically, I am trying to re-implement the Neural Network provided in the <a href="http://neuralnetworksanddeeplearning.com/chap1.html" rel="noreferrer">Neural Network and Deep Learning book by Michael Nielson</a>. The original code can be found <a href="https://github.com/mnielsen/neural-networks-and-deep-learning/blob/master/src/network.py" rel="noreferrer">here</a>. My implementation was the same as the original; however,  I instead defined and initialized weights and biases with <code>numpy.random.rand</code> in the <code>init</code> function, rather than the <code>numpy.random.randn</code>  function as shown in the original.</p>
  <p>However, my code that uses <code>random.rand</code> to initialize <code>weights and biases</code> does not work. The network won't learn and the weights and biases will not change.</p>
  <p>What is the difference(s) between the two random functions that cause this weirdness?</p>