xlnstorch.optim.lr_scheduler.LNSExponentialLR

xlnstorch.optim.lr_scheduler.LNSExponentialLR#

class xlnstorch.optim.lr_scheduler.LNSExponentialLR(optimizer, gamma, last_epoch=-1)#

An LNS learning rate scheduler that decays the learning rate of each parameter group by gamma each epoch.

See also: torch.optim.lr_scheduler.ExponentialLR

Parameters:
  • optimizer (LNSOptimizer) – Wrapped optimizer.

  • gamma (float | LNSTensor) – Multiplicative factor of learning rate decay.

  • last_epoch (int, optional) – The index of last epoch. Default: -1.

__init__(optimizer, gamma, last_epoch=-1)#
Parameters:
  • optimizer (LNSOptimizer)

  • gamma (float | LNSTensor)

  • last_epoch (int)

Methods

__init__(optimizer, gamma[, 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.