towhee.trainer.optimization.optimization.get_constant_schedule

towhee.trainer.optimization.optimization.get_constant_schedule(optimizer: torch.optim.optimizer.Optimizer, last_epoch: int = - 1)[source]

Create a schedule with a constant learning rate, using the learning rate set in optimizer.

Parameters:
  • optimizer (Optimizer) – The optimizer for which to schedule the learning rate.

  • last_epoch (int, optional, defaults to -1) – The index of the last epoch when resuming training.

Returns:

torch.optim.lr_scheduler.LambdaLR with the appropriate schedule.