xlnstorch.optim.lr_scheduler.LNSLambdaLR#
- class xlnstorch.optim.lr_scheduler.LNSLambdaLR(optimizer, lr_lambda, last_epoch=-1)#
An LNS learning rate scheduler that sets the learning rate of each parameter group to the initial learning rate multipled by a given function of the epoch.
See also:
torch.optim.lr_scheduler.LambdaLR- 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