kaiming_normal_

dragon.vm.torch.nn.init.kaiming_normal_(
  tensor,
  a=0,
  mode='fan_in',
  nonlinearity='leaky_relu'
)[source]

Fill tensor from a kaiming normal distribution.

\[\text{tensor} \sim \mathcal{N}(0, \sigma^{2}) \\ \, \\ \, \text{where} \quad \sigma = \text{gain} \times \sqrt{\frac{1}{\text{fan}}} \]
Parameters:
  • tensor (dragon.vm.torch.Tensor) – The input tensor.
  • a (number, optional, default=0) – The negative slope to compute gain value.
  • mode ({'fan_in', 'fan_out'}, optional) – The mode to compute fans.
  • nonlinearity (str, optional, default='leaky_relu') – The nonlinearity to compute gain value.
Returns:

dragon.vm.torch.Tensor – The input tensor.