Re: [Numpydiscussion] numpy.random.randn
On Wed, 7 Mar 2018 13:14:36, Robert Kern wrote:
With NumPy I'm simply using the following random initilization code:
np.random.randn(n_h, n_x) * 0.01
I'm trying to emulate the same behaviour in my Scala code by sampling from a Gaussian distribution with mean = 0 and std dev = 1.
`np.random.randn(n_h, n_x) * 0.01` gives a Gaussian distribution of mean=0 and stdev=0.01
Sorry for being a bit inaccurate. My Scala code actually mirrors the NumPy based random initialization, so I sample with Gaussian of mean = 0 and std dev = 1, then multiply with 0.01. Despite the extra step the result should be the same as with the NumPy code above. Is there anything else that could be different with the random initilization methods? marko
On Thu, Mar 8, 2018 at 12:44 PM, Marko Asplund
On Wed, 7 Mar 2018 13:14:36, Robert Kern wrote:
With NumPy I'm simply using the following random initilization code:
np.random.randn(n_h, n_x) * 0.01
I'm trying to emulate the same behaviour in my Scala code by sampling from a Gaussian distribution with mean = 0 and std dev = 1.
`np.random.randn(n_h, n_x) * 0.01` gives a Gaussian distribution of
mean=0
and stdev=0.01
Sorry for being a bit inaccurate. My Scala code actually mirrors the NumPy based random initialization, so I sample with Gaussian of mean = 0 and std dev = 1, then multiply with 0.01.
Have you verified this? I.e. save out the Scalainitialized network and load it up with numpy to check the mean and std dev? How about if you run the numpy NN training with the Scalainitialized network? Does that also diverge?  Robert Kern
participants (2)

Marko Asplund

Robert Kern