RandomUniform

class dragon.vm.tensorflow.keras.initializers.RandomUniform(
  minval=0,
  maxval=1,
  dtype='float32'
)[source]

Fill tensor from an uniform distribution.

\[\text{tensor} \sim \mathcal{U}(\alpha, \beta) \]

__init__

RandomUniform.__init__(
  minval=0,
  maxval=1,
  dtype='float32'
)[source]

Create a RandomUniform initializer.

Parameters:
  • minval (number, optional, default=0) – The value to \(\alpha\).
  • maxval (number, optional, default=1) – The value to \(\beta\).
  • dtype (str, optional, default='float32') – The data type to set as default.

Methods

__call__

RandomUniform.__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.