[Numpy-discussion] numpy.random.randn

Robert Kern robert.kern at gmail.com
Wed Mar 7 16:14:36 EST 2018


On Wed, Mar 7, 2018 at 1:10 PM, Marko Asplund <marko.asplund at gmail.com>
wrote:
>
> However, the results look very different when using random initialization.
> With respect to exact cost this is course expected, but what I find
troublesome
> is that  after N training iterations the cost starts approaching zero
with the NumPy
> code (most of of the time), whereas with the Scala based implementations
cost fails
> to converge (most of the time).
>
> 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

--
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180307/4774ec0e/attachment.html>


More information about the NumPy-Discussion mailing list