LRScheduler
- class LRScheduler(optimizer: Optimizer, last_epoch=-1, verbose='deprecated')[source]
Bases:
objectAdjusts the learning rate during optimization.
Methods Summary
Return last computed learning rate by current scheduler.
get_lr()Compute learning rate using chainable form of the scheduler.
load_state_dict(state_dict)Load the scheduler's state.
print_lr(is_verbose, group, lr[, epoch])Display the current learning rate.
Return the state of the scheduler as a
dict.step([epoch])Perform a step.
Methods Documentation
- Parameters:
optimizer (Optimizer)
- load_state_dict(state_dict: Dict[str, Any])[source]
Load the scheduler’s state.
- Args:
- state_dict (dict): scheduler state. Should be an object returned
from a call to
state_dict().
- print_lr(is_verbose: bool, group: Dict[str, Any], lr: float, epoch: int | None = None)[source]
Display the current learning rate.
Deprecated since version 2.4:
print_lr()is deprecated. Please useget_last_lr()to access the learning rate.