Skip to content

Constant

Constant initializer which always returns the same value.

Parameters

  • value (float)

Examples

>>> from river import optim

>>> init = optim.initializers.Constant(value=3.14)

>>> init(shape=1)
3.14

>>> init(shape=2)
array([3.14, 3.14])

Methods

call

Returns a fresh set of weights.

Parameters

  • shape – defaults to 1