Identity

public class Identity

Initializer that generates the identity matrix.

Only usable for generating 2D matrices.

Examples:

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

Constants

double GAIN_DEFAULT

Public Constructors

Identity(Ops tf)
Creates an Initializer that generates the identity matrix.
Identity(Ops tf, double gain)
Creates an Initializer that generates the identity matrix.

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 GAIN_DEFAULT

Constant Value: 1.0

Public Constructors

public Identity (Ops tf)

Creates an Initializer that generates the identity matrix.

Parameters
tf the TensorFlow Ops

public Identity (Ops tf, double gain)

Creates an Initializer that generates the identity matrix.

Parameters
tf the TensorFlow Ops
gain the gain to be applied to the Identity Matrix

Public Methods

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