glorot_uniform

dragon.random.glorot_uniform(
  shape,
  scale=3,
  mode='FAN_IN',
  dtype='float32',
  **kwargs
)[source]

Return a tensor initialized from the glorot uniform distribution.

The GlorotUniform distribution is defined as:

\[X \sim U( -\sqrt{\frac{scale}{\text{FAN}}}, \sqrt{\frac{scale}{\text{FAN}}} ) \]
Parameters:
  • shape (Sequence[Union[int, dragon.Tensor]]) – The shape of the tensor.
  • scale (number, optional, default=3) – The scale factor of distribution.
  • mode ({'FAN_IN', 'FAN_OUT', 'FAN_AVG'}, optional) – The mode to compute the normalizer.
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.