Have a question? Connect with the community at the TensorFlow Forum Visit Forum

RandomUniform

public class RandomUniform

Initializer that generates tensors with a uniform distribution.

Examples:

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

Constants

double MAXVAL_DEFAULT
double MINVAL_DEFAULT

Public Constructors

RandomUniform (Ops tf, long seed)
Creates a RandomUniform initializer using MINVAL_DEFAULT for the minval and MAXVAL_DEFAULT for the maxval
RandomUniform (Ops tf, double minval, double maxval, long seed)
Creates a RandomUniform initializer

Public Methods

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

Inherited Methods

Constants

public static final double MAXVAL_DEFAULT

Constant Value: 0.05

public static final double MINVAL_DEFAULT

Constant Value: -0.05

Public Constructors

public RandomUniform (Ops tf, long seed)

Creates a RandomUniform initializer using MINVAL_DEFAULT for the minval and MAXVAL_DEFAULT for the maxval

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 RandomUniform (Ops tf, double minval, double maxval, long seed)

Creates a RandomUniform initializer

Parameters
tf the TensorFlow Ops
minval Lower bound of the range of random values to generate (inclusive).
maxval Upper bound of the range of random values to generate (exclusive).
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)