GlorotNormal

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

Fill tensors according to a glorot normal distribution.

The GlorotNormal distribution is defined as:

\[X \sim N(0, \sqrt{\frac{\text{scale}}{\text{FAN}}}) \]

__init__

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

Create a GlorotNormal initializer.

Parameters:
  • scale (float, optional, default=2.) – The scale factor of distribution.
  • mode ({'FAN_IN', 'FAN_OUT', 'FAN_AVG'}, optional) – The mode to compute the normalizer.

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.