StepLR

scalation.modeling.autograd.StepLR
final class StepLR(optim: Optimizer, stepSize: Int, gamma: Double) extends LRScheduler

Step-based learning rate scheduler. Reduces the optimizer's learning rate by multiplying with gamma every stepSize epochs. Matches the behavior of PyTorch's StepLR for the single-LR (non–param-group) setting.

Value parameters

gamma

the multiplicative decay factor applied every step

optim

the optimizer whose learning rate will be scheduled

stepSize

the interval (in epochs) between LR reductions

Attributes

Graph
Supertypes
trait LRScheduler
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def getLastLR: Double

Return the most recently updated learning rate.

Return the most recently updated learning rate.

Attributes

override def step(): Unit

Advance the scheduler by one epoch. When the epoch count is divisible by stepSize, reduce the learning rate by multiplying with gamma.

Advance the scheduler by one epoch. When the epoch count is divisible by stepSize, reduce the learning rate by multiplying with gamma.

Attributes

Definition Classes

Inherited methods

def step(currentLoss: Double): Unit

Advance the scheduler using the current loss (loss-based scheduling). Default implementation throws an exception; override if supported.

Advance the scheduler using the current loss (loss-based scheduling). Default implementation throws an exception; override if supported.

Value parameters

currentLoss

the current loss value used for scheduling

Attributes

Inherited from:
LRScheduler