megengine.module.init.msra_uniform_¶
- msra_uniform_(tensor, a=0, mode='fan_in', nonlinearity='leaky_relu')[源代码]¶
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}}}\]参考 “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 \(bound\). Seecalculate_fan_in_and_fan_out
for details.nonlinearity (
str
) – 用于计算 \(gain\) 的非线性函数的名称。请参阅calculate_gain
了解详情。
- 返回类型