TruncatedNormal

class dragon.vm.tensorlayer.initializers.TruncatedNormal(
  mean=0.0,
  stddev=0.05
)[source]

Fill tensor from a truncated normal distribution.

\[\text{tensor} \sim \mathcal{TN}(\mu, \sigma^{2}, \mu - 2\sigma, \mu + 2\sigma) \]

__init__

TruncatedNormal.__init__(
  mean=0.0,
  stddev=0.05
)[source]

Create a TruncatedNormal initializer.

Parameters:
  • mean (number, optional, default=0.) – The value to \(\mu\).
  • stddev (number, optional, default=0.05) – The value to \(\sigma\).

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.