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

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.