jax.nn.initializers.normal#
- jax.nn.initializers.normal(stddev=0.01, dtype=<class 'jax.numpy.float64'>)[source]#
Builds an initializer that returns real normally-distributed random arrays.
- Parameters:
stddev (RealNumeric) – optional; the standard deviation of the distribution.
dtype (DTypeLikeInexact) – optional; the initializer’s default dtype.
- Returns:
An initializer that returns arrays whose values are normally distributed with mean
0
and standard deviationstddev
.- Return type:
Initializer
>>> import jax, jax.numpy as jnp >>> initializer = jax.nn.initializers.normal(5.0) >>> initializer(jax.random.key(42), (2, 3), jnp.float32) Array([[ 3.0613258 , 5.6129413 , 5.6866574 ], [-4.063663 , -4.4520254 , 0.63115686]], dtype=float32)