Package ai.djl.training.initializer
Class NormalInitializer
java.lang.Object
ai.djl.training.initializer.NormalInitializer
- All Implemented Interfaces:
Initializer
NormalInitializer
initializes weights with random values sampled from a normal
distribution with a mean of zero and standard deviation of sigma
. Default standard
deviation is 0.01.-
Field Summary
Fields inherited from interface ai.djl.training.initializer.Initializer
ONES, ZEROS
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance ofNormalInitializer
with a default sigma of 0.01.NormalInitializer
(float sigma) Creates a Normal initializer. -
Method Summary
-
Constructor Details
-
NormalInitializer
public NormalInitializer()Creates an instance ofNormalInitializer
with a default sigma of 0.01. -
NormalInitializer
public NormalInitializer(float sigma) Creates a Normal initializer.- Parameters:
sigma
- the standard deviation of the normal distribution
-
-
Method Details
-
initialize
Initializes a singleNDArray
.- Specified by:
initialize
in interfaceInitializer
- Parameters:
manager
- theNDManager
to create the newNDArray
inshape
- theShape
for the new NDArraydataType
- theDataType
for the new NDArray- Returns:
- the
NDArray
initialized with the manager and shape
-