swa_lrs (float or list) – the learning rate value for all param groups
together or separately for each group.
annealing_epochs (int) – number of epochs in the annealing phase
(default: 10)
annealing_strategy (str) – “cos” or “linear”; specifies the annealing
strategy: “cos” for cosine annealing, “linear” for linear annealing
(default: “cos”)
last_epoch (int) – the index of the last epoch (default: -1)
The SWALR scheduler can be used together with other
schedulers to switch to a constant learning rate late in the training
as in the example below.
Compute the next learning rate for each of the optimizer’s
param_groups.
Uses anneal_func to interpolate between each group’s
group["lr"] and group["swa_lr"] over anneal_epochs
epochs. Once anneal_epochs is reached, keeps the learning rate
fixed at group["swa_lr"].
Returns:
A list of learning rates for each of
the optimizer’s param_groups with the
same types as their current group["lr"]s.