Create a schedule with a constant learning rate, using the learning rate set in optimizer. Args: optimizer ([`~torch.optim.Optimizer`]): The optimizer for which to schedule the learning rate. last_epoch (`int`, *optional*, defaults to -1): The index
(optimizer: Optimizer, last_epoch: int = -1)
| 38 | |
| 39 | |
| 40 | def get_constant_schedule(optimizer: Optimizer, last_epoch: int = -1) -> LambdaLR: |
| 41 | """ |
| 42 | Create a schedule with a constant learning rate, using the learning rate set in optimizer. |
| 43 | |
| 44 | Args: |
| 45 | optimizer ([`~torch.optim.Optimizer`]): |
| 46 | The optimizer for which to schedule the learning rate. |
| 47 | last_epoch (`int`, *optional*, defaults to -1): |
| 48 | The index of the last epoch when resuming training. |
| 49 | |
| 50 | Return: |
| 51 | `torch.optim.lr_scheduler.LambdaLR` with the appropriate schedule. |
| 52 | """ |
| 53 | return LambdaLR(optimizer, lambda _: 1, last_epoch=last_epoch) |
| 54 | |
| 55 | |
| 56 | def get_constant_schedule_with_warmup(optimizer: Optimizer, num_warmup_steps: int, last_epoch: int = -1) -> LambdaLR: |
nothing calls this directly
no outgoing calls
no test coverage detected