Weight Initializers¶
Weight initializers are used to initialize arrays.
They destructively modify the content of numpy.ndarray
or cupy.ndarray
.
Typically, weight initializers are passed to Link
s
to initialize their weights and biases.
A weight initializer can be any of the following objects.
chainer.Initializer
class instance.Python or NumPy scalar or
numpy.ndarray
.A callable that takes an array (
numpy.ndarray
orcupy.ndarray
) and feeds the initial data into it.None
, in which case the default initializer is used. Unless explicitly specified, it isLeCunNormal
with scale value 1.
If an initializer object has the dtype
attribute, the initializer can assume that the array to feed the data into has that dtype. If the required dtype, depending on the context where the initializer is used, does not match the dtype
attribute, Chainer will report an error.
Base class¶
Initializes array. |
Concrete initializers¶
Initializes array with the identity matrix. |
|
Initializes array with constant value. |
|
Initializes array to all-zero. |
|
Initializes array to all-one. |
|
Initializes array to all-NaN. |
|
Initializes array with a normal distribution. |
|
Initializes array with scaled Gaussian distribution. |
|
Initializes array with scaled Gaussian distribution. |
|
Initializes array with scaled Gaussian distribution. |
|
Initializes array with an orthogonal system. |
|
Initializes array with a scaled uniform distribution. |
|
Initializes array with a scaled uniform distribution. |
|
Initializes array with a scaled uniform distribution. |
|
Initializes array with scaled uniform distribution. |
Helper function¶
Return initialized array. |