VarianceScaling

class dragon.vm.tensorflow.keras.initializers.VarianceScaling(
  scale=1.0,
  mode='fan_out',
  distribution='normal',
  dtype='float32'
)[source]

Fill tensor from a scaled random distribution.

__init__

VarianceScaling.__init__(
  scale=1.0,
  mode='fan_out',
  distribution='normal',
  dtype='float32'
)[source]

Create a RandomNormal initializer.

Parameters:
  • scale (float, optional, default=1) The scale factor to distribution.
  • mode ({'fan_in', 'fan_out', 'fan_avg'}, optional) The mode for adapting to shape.
  • distribution ({'normal', 'uniform'}, optional) The optional distribution to generate values.
  • dtype (str, optional, default='float32') The data type to set as default.

Methods

__call__

VarianceScaling.__call__(
  shape,
  dtype=None,
  **kwargs
)[source]

Return a tensor initialized from the initializer.

Parameters:
  • shape (Sequence[int]) The tensor shape.
  • dtype (str, optional) The optional data type.
Returns:

dragon.Tensor The output tensor.