megengine.module.init.msra_normal_¶
- msra_normal_(tensor, a=0, mode='fan_in', nonlinearity='leaky_relu')[源代码]¶
Fills tensor wilth random values sampled from \(\mathcal{N}(0, \text{std}^2)\) where
\[\text{std} = \sqrt{\frac{2}{(1 + a^2) \times \text{fan_in}}}\]参考 “Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification” 获取详细说明
- 参数
tensor (
Tensor
) – 待初始化的n维张量a (
float
) – 用于计算leaky_relu增益的可选参数。请参阅:calculate_gain
了解详情。mode (
str
) – fan_in” or “fan_out”, used to calculate \(gain\), the scaling factor for \(gain\). Seecalculate_fan_in_and_fan_out
for details.nonlinearity (
str
) – 用于计算 \(gain\) 的非线性函数的名称。请参阅calculate_gain
了解详情。
- 返回类型