hive.utils.schedule module
- class hive.utils.schedule.Schedule[source]
Bases:
ABC
,Registrable
- class hive.utils.schedule.LinearSchedule(init_value, end_value, steps)[source]
Bases:
Schedule
Defines a linear schedule between two values over some number of steps.
If updated more than the defined number of steps, the schedule stays at the end value.
- Parameters
- class hive.utils.schedule.ConstantSchedule(value)[source]
Bases:
Schedule
Returns a constant value over the course of the schedule
- Parameters
value – The value to be returned.
- class hive.utils.schedule.SwitchSchedule(off_value, on_value, steps)[source]
Bases:
Schedule
Returns one value for the first part of the schedule. After the defined number of steps is reached, switches to returning a second value.
- Parameters
off_value – The value to be returned in the first part of the schedule.
on_value – The value to be returned in the second part of the schedule.
steps (int) – The number of steps after which to switch from the off value to the on value.
- class hive.utils.schedule.DoublePeriodicSchedule(off_value, on_value, off_period, on_period)[source]
Bases:
Schedule
Returns off value for off period, then switches to returning on value for on period. Alternates between the two.
- Parameters
- class hive.utils.schedule.PeriodicSchedule(off_value, on_value, period)[source]
Bases:
DoublePeriodicSchedule
Returns one value on the first step of each period of a predefined number of steps. Returns another value otherwise.
- Parameters
on_value – The value to be returned on the first step of each period.
off_value – The value to be returned for every other step in the period.
period (int) – The number of steps in the period.