compile_composer_scheduler#
- composer.optim.compile_composer_scheduler(scheduler, state, ssr=1.0)[source]#
Converts a stateless scheduler into a PyTorch scheduler object.
While the resulting scheduler provides a
.step()
interface similar to other PyTorch schedulers, the scheduler is also given a bound reference to the currentState
. This means that any internal state updated by.step()
can be ignored, and the scheduler can instead simply use the bound state to recalculate the current learning rate.- Parameters
scheduler (ComposerScheduler) โ A stateless scheduler, provided as a
ComposerScheduler
object.state (State) โ The Composer Trainerโs state.
- Returns
compiled_scheduler (PyTorchScheduler) โ The scheduler, in a form compatible with PyTorch scheduler interfaces.