Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.98 KB

initializers.rst

File metadata and controls

69 lines (53 loc) · 1.98 KB

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 ~chainer.Links 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 or cupy.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.

Base class

chainer.Initializer

chainer.initializers

chainer

Concrete initializers

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

Helper function

chainer.initializers.generate_array