[Numpy-discussion] numpy.random.randn
Marko Asplund
marko.asplund at gmail.com
Thu Mar 8 15:44:39 EST 2018
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180308/456fe322/attachment.html>
More information about the NumPy-Discussion
mailing list