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” 。