helios.scheduler.utils¶
Attributes¶
Global instance of the registry for schedulers. |
Functions¶
|
Create the scheduler for the given type. |
Module Contents¶
- helios.scheduler.utils.SCHEDULER_REGISTRY¶
Global instance of the registry for schedulers.
By default, the registry contains the following schedulers:
Schedulers¶ Scheduler
Name
torch.optim.lr_scheduler.LambdaLRLambdaLR
torch.optim.lr_scheduler.MultiplicativeLRMultiplicativeLR
torch.optim.lr_scheduler.StepLRStepLR
torch.optim.lr_scheduler.MultiStepLRMultiStepLR
torch.optim.lr_scheduler.ConstantLRConstantLR
torch.optim.lr_scheduler.LinearLRLinearLR
torch.optim.lr_scheduler.ExponentialLRExponentialLR
torch.optim.lr_scheduler.PolynomialLRPolynomialLR
torch.optim.lr_scheduler.CosineAnnealingLRCosineAnnealingLR
torch.optim.lr_scheduler.SequentialLRSequentialLR
torch.optim.lr_scheduler.ReduceLROnPlateauReduceLROnPlateau
torch.optim.lr_scheduler.CyclicLRCyclicLR
torch.optim.lr_scheduler.OneCycleLROneCycleLR
torch.optim.lr_scheduler.CosineAnnealingWarmRestartsCosineAnnealingWarmRestarts
CosineAnnealingRestartLR
MultiStepRestartLR
Example
import helios.optim as hlo import helios.scheduler as hls # This automatically registers your optimizer. @hls.SCHEDULER_REGISTRY.register class MyScheduler: ... # Alternatively you can manually register a scheduler. like this: hls.SCHEDULER_REGISTRY.register(MyScheduler)
- helios.scheduler.utils.create_scheduler(type_name: str, *args: Any, **kwargs: Any) torch.optim.lr_scheduler.LRScheduler[source]¶
Create the scheduler for the given type.
- Parameters:
type_name – the type of the scheduler to create.
args – positional arguments to pass into the scheduler.
kwargs – keyword arguments to pass into the scheduler.
- Returns:
The scheduler.