Class LeCun<T extends TFloating>
java.lang.Object
org.tensorflow.framework.initializers.BaseInitializer<T>
org.tensorflow.framework.initializers.VarianceScaling<T>
org.tensorflow.framework.initializers.LeCun<T>
- Type Parameters:
T- The TType for the call operation
- All Implemented Interfaces:
Initializer<T>
LeCun normal initializer.
Draws samples from a random distribution. * *
If the distribution is TRUNCATED_NORMAL, it draws samples from a truncated normal distribution
centered on 0 with
stddev = sqrt(1 / 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 = Math.sqrt(3 / fanIn) (fanIn is
the number of input units in the weight tensor)
Examples:
LeCun Normal:
long seed = 1001l;
LeCunNormal<TFloat32, TFloat32> initializer =
new org.tensorflow.framework.initializers.LeCunNormal<>(tf,
Distribution.TRUNCATED_NORMAL, seed);
Operand<TFloat32> values =
initializer.call(Ops tf, tf.constant(Shape.of(2,2)), TFloat32.class);
LeCun Uniform:
long seed = 1001l;
LeCunNormal<TFloat32, TFloat32> initializer =
new org.tensorflow.framework.initializers.LeCunNormal<>(tf,
Distribution.UNIFORM, seed);
Operand<TFloat32> values =
initializer.call(Ops tf, tf.constant(Shape.of(2,2)), TFloat32.class);
*
NOTE: *
For a LeCunNormal equivalent initializer, use VarianceScaling.Distribution.TRUNCATED_NORMAL for the distribution parameter. *
For a LeCunUniform equivalent initializer, use VarianceScaling.Distribution.UNIFORM *
for the distribution parameter. *
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class VarianceScaling
VarianceScaling.Distribution, VarianceScaling.Mode -
Field Summary
Fields inherited from class VarianceScaling
DISTRIBUTION_DEFAULT, MODE_DEFAULT, SCALE_DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionLeCun(VarianceScaling.Distribution distribution, long seed) Creates a LeCunNormal Initializer -
Method Summary
Methods inherited from class VarianceScaling
callMethods inherited from class BaseInitializer
getName
-
Constructor Details
-
LeCun
Creates a LeCunNormal Initializer- Parameters:
distribution- The distribution type for the Glorot 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.
-