Schedules¶
Module contents¶
-
class
olympus.optimizers.schedules.LRSchedule(name=None, *, schedule=None, optimizer=None, **kwargs)[source]¶ Bases:
objectLazy LRSchedule that allows you to first fetch the supported parameters using
get_spaceand then initialize the underlying schedule usinginit_optimizerParameters: - name: str
Name of a registered schedule
- schedule: LRSchedule
Custom schedule, mutually exclusive with :param name
Raises: - RegisteredLRSchedulerNotFound
when using a name of an known schedule
- MissingArgument:
if name nor schedule were not set
Examples
>>> schedule = LRSchedule('cyclic') >>> schedule.get_space() {'base_lr': 'loguniform(1e-5, 1e-2)', 'max_lr': 'loguniform(1e-2, 1)', ... } >>> schedule.init(optimizer, base_lr=1e-2, ...)
Attributes: defaultsReturn default hyper parameters
- lr_scheduler
Methods
epoch(self, epoch[, metrics])Called after every epoch to update LR get_current_space(self)Get currently defined parameter space get_space(self)Return the missing hyper parameters required to initialize the LR schedule init(self[, optimizer, override])Initialize the LR schedule with the given hyper parameters step(self, step[, metrics])Called every step/batch to update LR get_lr load_state_dict state_dict -
defaults¶ Return default hyper parameters
-
init(self, optimizer=None, override=False, **kwargs)[source]¶ Initialize the LR schedule with the given hyper parameters
-
lr_scheduler¶