mlx.nn.init.normal#
- normal(mean: float = 0.0, std: float = 1.0, dtype: Dtype = mlx.core.float32) Callable[[array], array] #
An initializer that returns samples from a normal distribution.
- Parameters:
- Returns:
An initializer that returns an array with the same shape as the input, filled with samples from a normal distribution.
- Return type:
Example
>>> init_fn = nn.init.normal() >>> init_fn(mx.zeros((2, 2))) array([[-0.982273, -0.534422], [0.380709, 0.0645099]], dtype=float32)