megengine.module.init.msra_normal_¶
-
msra_normal_
(tensor, a=0, mode='fan_in', nonlinearity='leaky_relu')[源代码]¶ 从 \(\mathcal{N}(0, \text{std}^2)\) 中随机采样得到值,填入
tensor
,式中,\[\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'
或'fan_out'
,用于计算 \(gain\) ,是 \(gain\) 的比例因子。请参阅calculate_fan_in_and_fan_out
了解详情。nonlinearity (
str
) – 用于计算 \(gain\) 的非线性函数的名称。请参阅calculate_gain
了解详情。
- 返回类型