TruncatedNormalInitializer

class paddle.fluid.initializer. TruncatedNormalInitializer ( loc=0.0, scale=1.0, seed=0 ) [source]

Implements the Random TruncatedNormal(Gaussian) distribution initializer

Parameters
  • loc (float) – mean of the normal distribution

  • scale (float) – standard deviation of the normal distribution

  • seed (int) – random seed

Examples

import paddle.fluid as fluid
x = fluid.data(name='x', shape=[None, 1], dtype='float32')
fc = fluid.layers.fc(input=x, size=10,
    param_attr=fluid.initializer.TruncatedNormal(loc=0.0, scale=2.0))
forward ( var, block=None )

forward

Initialize the input tensor with TruncatedNormal distribution.

Parameters
  • var (Tensor) – Tensor that needs to be initialized.

  • block (Block, optional) – The block in which initialization ops should be added. Used in static graph only, default None.

Returns

The initialization op