Package ai.djl.training.initializer
Class NormalInitializer
- java.lang.Object
-
- ai.djl.training.initializer.NormalInitializer
-
- All Implemented Interfaces:
Initializer
public class NormalInitializer extends java.lang.Object implements Initializer
NormalInitializer
initializes weights with random values sampled from a normal distribution with a mean of zero and standard deviation ofsigma
. Default standard deviation is 0.01.
-
-
Field Summary
-
Fields inherited from interface ai.djl.training.initializer.Initializer
ONES, ZEROS
-
-
Constructor Summary
Constructors Constructor Description NormalInitializer()
Creates an instance ofNormalInitializer
with a default sigma of 0.01.NormalInitializer(float sigma)
Creates a Normal initializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDArray
initialize(NDManager manager, Shape shape, DataType dataType)
Initializes a singleNDArray
.
-
-
-
Method Detail
-
initialize
public NDArray initialize(NDManager manager, Shape shape, DataType dataType)
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
-
-