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

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

org.tensorflow.framework.initializers.BaseInitializer
Ops
getTF()
Gets the TensorFlow Ops
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
org.tensorflow.framework.initializers.Initializer
abstract Operand<T>
call(Operand<TInt64> dims, Class<T> type)
Generates the operation used to perform the initialization.

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)