GlorotNormal

class dragon.vm.tensorlayer.initializers.GlorotNormal(
  mode='fan_in',
  scale=2.0
)[source]

Fill tensor from a glorot normal distribution.

\[\text{tensor} \sim \mathcal{N}(0, \frac{\text{scale}}{\text{fan}}) \]

__init__

GlorotNormal.__init__(
  mode='fan_in',
  scale=2.0
)[source]

Create a GlorotNormal initializer.

Parameters:
  • mode ({'fan_in', 'fan_out', 'fan_avg'}, optional) – The mode to compute the fans.
  • scale (float, optional, default=2.0) – The scale factor to distribution.

Methods

__call__

Initializer.__call__(
  shape,
  dtype='float32',
  **kwargs
)[source]

Return a tensor initialized as specified initializer.

Parameters:
  • shape (Sequence[int]) – The shape of the tensor.
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.