PiecewiseConstantLR

PiecewiseConstantLR

class modelzoo.common.pytorch.optim.lr_scheduler.PiecewiseConstantLR (optimizer, learning_rates: List[float], milestones: List[int], disable_lr_steps_reset: bool = False)

Adjusts the learning rate to a predefined constant at each milestone and holds this value until the next milestone. Notice that such adjustment can happen simultaneously with other changes to the learning rate from outside this scheduler.

Parameters:

optimizer – The optimizer to schedule

learning_rates – List of learning rates to maintain before/during each milestone

milestones – List of step indices; must be increasing