xlnstorch.optim.lr_scheduler.LNSSequentialLR#
- class xlnstorch.optim.lr_scheduler.LNSSequentialLR(optimizer, schedulers, milestones, last_epoch=-1)#
A scheduler that applies a sequence of schedulers in order.
Note that this scheduler is a subclass of torch’s SequentialLR, and is implemented for completeness. You can use the torch version directly with LNS optimizers.
See also:
torch.optim.lr_scheduler.SequentialLR- Parameters:
optimizer (LNSOptimizer) – Wrapped optimizer.
schedulers (List[torch.optim.lr_scheduler.LRScheduler]) – List of schedulers to apply sequentially.
milestones (List[int]) – List of epochs at which to switch to the next scheduler.
last_epoch (int, optional) – The index of last epoch. Default: -1.
- __init__(optimizer, schedulers, milestones, last_epoch=-1)#
- Parameters:
optimizer (LNSOptimizer)
schedulers (List[LRScheduler])
last_epoch (int)
Methods
__init__(optimizer, schedulers, milestones)get_last_lr()Return last computed learning rate by current scheduler.
get_lr()Compute learning rate using chainable form of the scheduler.
load_state_dict(state_dict)Load the scheduler's state.
recursive_undo([sched])Recursively undo any step performed by the initialisation of schedulers.
state_dict()Return the state of the scheduler as a
dict.step()Perform a step.