xlnstorch.optim.lr_scheduler.LNSStepLR

xlnstorch.optim.lr_scheduler.LNSStepLR#

class xlnstorch.optim.lr_scheduler.LNSStepLR(optimizer, step_size, gamma=0.1, last_epoch=-1)#

An LNS learning rate scheduler that decays the learning rate of each parameter group by a factor of gamma every step_size epochs.

See also: torch.optim.lr_scheduler.StepLR

Parameters:
  • optimizer (LNSOptimizer) – Wrapped optimizer.

  • step_size (int) – Period of learning rate decay.

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

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

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

  • step_size (int)

  • gamma (float | LNSTensor)

  • last_epoch (int)

Methods

__init__(optimizer, step_size[, gamma, ...])

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.