optax.schedules.constant_schedule

optax.schedules.constant_schedule#

optax.schedules.constant_schedule(value: jax.typing.ArrayLike) base.Schedule[source]#

Constructs a constant schedule.

Parameters:

value โ€“ value to be held constant throughout.

Returns:

schedule

A function that maps step counts to values.

Examples

>>> schedule_fn = optax.constant_schedule(5)
>>> schedule_fn(0)
5
>>> schedule_fn(100)
5