He

public class He

He initializer.

If the distribution is TRUNCATED_NORMAL, it draws samples from a truncated normal distribution centered on 0 with stddev = sqrt(2 / fanIn) where fanIn is the number of input units in the weight tensor.

If the distribution is UNIFORM, it draws samples from a uniform distribution within [-limit, limit], where limit = sqrt(6 / fanIn) (fanIn is the number of input units in the weight tensor).

Examples:

He Normal:

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

He Uniform:

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

NOTE:

For an HeNormal equivalent initializer, use TRUNCATED_NORMAL for the distribution parameter.

For an HeUniform equivalent initializer, use UNIFORM for the distribution parameter.

Constants

double SCALE

Inherited Constants

org.tensorflow.framework.initializers.VarianceScaling
double SCALE_DEFAULT

Inherited Fields

org.tensorflow.framework.initializers.VarianceScaling

Public Constructors

He(Ops tf, VarianceScaling.Distribution distribution, long seed)
Creates an He Initializer

Inherited Methods

org.tensorflow.framework.initializers.VarianceScaling
Operand<T>
call(Operand<TInt64> dims, Class<T> type)
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 SCALE

Constant Value: 2.0

Public Constructors

public He (Ops tf, VarianceScaling.Distribution distribution, long seed)

Creates an He Initializer

Parameters
tf the TensorFlow Ops
distribution The distribution type for the He initializer.
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.