RandomUniform

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

Fill tensors according to a random uniform distribution.

The RandomUniform distribution is defined as:

\[X \sim 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 of \(\alpha\).
  • maxval (number, optional, default=0.05) – The value of \(\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.