megengine.module.init.msra_uniform_#

msra_uniform_(tensor, a=0, mode='fan_in', nonlinearity='leaky_relu')[source]#

Fills tensor wilth random values sampled from \(\mathcal{U}(-\text{bound}, \text{bound})\) where

\[\text{bound} = \sqrt{\frac{6}{(1 + a^2) \times \text{fan_in}}}\]

Detailed information can be retrieved from Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification

Parameters:
  • tensor (Tensor) – tensor to be initialized.

  • a (float) – optional parameter for calculating gain for leaky_relu. See calculate_gain for details.

  • mode (str) – fan_in” or “fan_out”, used to calculate \(gain\), the scaling factor for \(bound\). See calculate_fan_in_and_fan_out for details.

  • nonlinearity (str) – name of the non-linear function used to calculate \(gain\). See calculate_gain for details.

Return type:

None