paddlespeech.vector.training.scheduler module
- class paddlespeech.vector.training.scheduler.CyclicLRScheduler(base_lr: float = 1e-08, max_lr: float = 0.001, step_size: int = 10000)[source]
Bases:
LRSchedulerMethods
__call__()Return lastest computed learning rate on current epoch.
get_lr()For those subclass who overload
LRScheduler(Base Class), User should have a custom implementation ofget_lr().set_dict(state_dict)Loads the schedulers state.
set_state_dict(state_dict)Loads the schedulers state.
state_dict()Returns the state of the scheduler as a
dict.state_keys()For those subclass who overload
LRScheduler(Base Class).step()stepshould be called afteroptimizer.step.- get_lr()[source]
For those subclass who overload
LRScheduler(Base Class), User should have a custom implementation ofget_lr().Otherwise, an
NotImplementedErrorexception will be thrown.
- step()[source]
stepshould be called afteroptimizer.step. It will update the learning rate in optimizer according to currentepoch. The new learning rate will take effect on nextoptimizer.step.- Args:
epoch (int, None): specify current epoch. Default: None. Auto-increment from last_epoch=-1.
- Returns:
None