Package ai.djl.training.initializer
Class UniformInitializer
java.lang.Object
ai.djl.training.initializer.UniformInitializer
- All Implemented Interfaces:
Initializer
UniformInitializer
initializes weights with random values uniformly sampled from a given
range.-
Field Summary
Fields inherited from interface ai.djl.training.initializer.Initializer
ONES, ZEROS
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance ofUniformInitializer
with a defaultscale
of 0.07.UniformInitializer
(float scale) Initializes a uniform initializer. -
Method Summary
-
Constructor Details
-
UniformInitializer
public UniformInitializer()Creates an instance ofUniformInitializer
with a defaultscale
of 0.07. -
UniformInitializer
public UniformInitializer(float scale) Initializes a uniform initializer.- Parameters:
scale
- the bound on the range of the generated random values. Values are generated from the range [-`scale`, `scale`]. Default scale is 0.07.
-
-
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
-