LecunNormal

Contents

LecunNormal#

class braintools.init.LecunNormal(scale=1.0, unit=None)#

LeCun normal initialization.

Samples from a normal distribution with standard deviation computed to maintain variance across layers. Similar to Xavier but uses fan_in only. Recommended for SELU activations.

Reference: LeCun et al., “Efficient BackProp”, 1998.

Parameters:

scale (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Scaling factor (default: 1.0).

Examples

>>> import numpy as np
>>> from braintools.init import LecunNormal
>>>
>>> init = LecunNormal()
>>> rng = np.random.default_rng(0)
>>> weights = init((100, 50), rng=rng)