TruncatedNormal

public class TruncatedNormal

Initializer that generates a truncated normal distribution.

Examples:

     long seed = 1001l;
     TruncatedNormal<TFloat32, TFloat32> initializer =
              new org.tensorflow.framework.initializers.TruncatedNormal<>(tf, seed);
     Operand<TFloat32> values =
              initializer.call(tf.constant(Shape.of(2,2)), TFloat32.class);
 

Constants

double MEAN_DEFAULT
double STDDEV_DEFAULT

Public Constructors

TruncatedNormal(Ops tf, long seed)
Creates a TruncatedNormal Initializer using MEAN_DEFAULT for the mean and STDDEV_DEFAULT for the standard deviation.
TruncatedNormal(Ops tf, double mean, double stddev, long seed)
Creates a TruncatedNormal Initializer.

Public Methods

Operand<T>
call(Operand<TInt64> dims, Class<T> type)

Inherited Methods

Constants

public static final double MEAN_DEFAULT

Constant Value: 0.0

public static final double STDDEV_DEFAULT

Constant Value: 0.05

Public Constructors

public TruncatedNormal (Ops tf, long seed)

Creates a TruncatedNormal Initializer using MEAN_DEFAULT for the mean and STDDEV_DEFAULT for the standard deviation.

Parameters
tf the TensorFlow Ops
seed the seed for random number generation. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype.

public TruncatedNormal (Ops tf, double mean, double stddev, long seed)

Creates a TruncatedNormal Initializer.

Parameters
tf the TensorFlow Ops
mean Mean of the random values to generate.
stddev Standard deviation of the random values to generate.
seed the seed for random number generation. An initializer created with a given seed will always produce the same random tensor for a given shape and dtype.

Public Methods

public Operand<T> call (Operand<TInt64> dims, Class<T> type)