RandomUniform

class dragon.vm.tensorlayer.initializers.RandomUniform(
  minval=- 0.05,
  maxval=0.05
)[source]

Fill tensors from an uniform distribution.

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

__init__

RandomUniform.__init__(
  minval=- 0.05,
  maxval=0.05
)[source]

Create a RandomUniform initializer.

Parameters:
  • minval (number, optional, default=-0.05) – The value to \(\alpha\).
  • maxval (number, optional, default=0.05) – The value to \(\beta\).

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.