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 Links to initialize their weights and biases.

A weight initializer can be any of the following objects.

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

chainer.Initializer

Initializes array.

Concrete initializers

chainer.initializers.Identity

Initializes array with the identity matrix.

chainer.initializers.Constant

Initializes array with constant value.

chainer.initializers.Zero

Initializes array to all-zero.

chainer.initializers.One

Initializes array to all-one.

chainer.initializers.NaN

Initializes array to all-NaN.

chainer.initializers.Normal

Initializes array with a normal distribution.

chainer.initializers.LeCunNormal

Initializes array with scaled Gaussian distribution.

chainer.initializers.GlorotNormal

Initializes array with scaled Gaussian distribution.

chainer.initializers.HeNormal

Initializes array with scaled Gaussian distribution.

chainer.initializers.Orthogonal

Initializes array with an orthogonal system.

chainer.initializers.Uniform

Initializes array with a scaled uniform distribution.

chainer.initializers.LeCunUniform

Initializes array with a scaled uniform distribution.

chainer.initializers.GlorotUniform

Initializes array with a scaled uniform distribution.

chainer.initializers.HeUniform

Initializes array with scaled uniform distribution.

Helper function

chainer.initializers.generate_array

Return initialized array.