Weight initializers are used to initialize arrays. They destructively modify the content of numpy.ndarray
or cupy.ndarray
. Typically, weight initializers are passed to ~chainer.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 is~chainer.initializers.LeCunNormal
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.
chainer.Initializer
chainer.initializers
chainer
chainer.initializers.Identity chainer.initializers.Constant chainer.initializers.Zero chainer.initializers.One chainer.initializers.NaN chainer.initializers.Normal chainer.initializers.LeCunNormal chainer.initializers.GlorotNormal chainer.initializers.HeNormal chainer.initializers.Orthogonal chainer.initializers.Uniform chainer.initializers.LeCunUniform chainer.initializers.GlorotUniform chainer.initializers.HeUniform
chainer.initializers.generate_array