xlnstorch.optim.lr_scheduler.LNSMultiplicativeLR#
- class xlnstorch.optim.lr_scheduler.LNSMultiplicativeLR(optimizer, lr_lambda, last_epoch=-1)#
An LNS learning rate scheduler that sets the learning rate of each parameter group to the previous learning rate multipled by a given multiplicative factor.
See also:
torch.optim.lr_scheduler.MultiplicativeLR- Parameters:
optimizer (LNSOptimizer) – Wrapped optimizer.
lr_lambda (Callable[[int], float | LNSTensor] or List[Callable[[int], float | LNSTensor]]) – A function or a list of functions which computes a multiplicative factor given an integer parameter epoch, which is the index of the current epoch.
last_epoch (int, optional) – The index of last epoch. Default: -1.
- __init__(optimizer, lr_lambda, last_epoch=-1)#
Methods
__init__(optimizer, lr_lambda[, last_epoch])get_last_lr()Return last computed learning rate by current scheduler.
get_lr()Compute the learning rate of each parameter group.
load_state_dict(state_dict)Load the scheduler's state.
state_dict()Return the state of the scheduler as a
dict.step([epoch])Perform a step.