megengine.module.init.xavier_normal_¶
- xavier_normal_(tensor, gain=1.0)[源代码]¶
从正态分布 \(\mathcal{N}(0, \text{std}^2)\) 中采样随机值填充给定
tensor
。\[\text{std} = \text{gain} \times \sqrt{\frac{2}{\text{fan_in} + \text{fan_out}}}\]又称Glorot初始化。详细的说明可以参考 “Understanding the difficulty of training deep feedforward neural networks” 。