helios.scheduler.utils

Attributes

SCHEDULER_REGISTRY

Global instance of the registry for schedulers.

Functions

create_scheduler(→ torch.nn.Module)

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.LambdaLR

LambdaLR

torch.optim.lr_scheduler.MultiplicativeLR

MultiplicativeLR

torch.optim.lr_scheduler.StepLR

StepLR

torch.optim.lr_scheduler.MultiStepLR

MultiStepLR

torch.optim.lr_scheduler.ConstantLR

ConstantLR

torch.optim.lr_scheduler.LinearLR

LinearLR

torch.optim.lr_scheduler.ExponentialLR

ExponentialLR

torch.optim.lr_scheduler.PolynomialLR

PolynomialLR

torch.optim.lr_scheduler.CosineAnnealingLR

CosineAnnealingLR

torch.optim.lr_scheduler.SequentialLR

SequentialLR

torch.optim.lr_scheduler.ReduceLROnPlateau

ReduceLROnPlateau

torch.optim.lr_scheduler.CyclicLR

CyclicLR

torch.optim.lr_scheduler.OneCycleLR

OneCycleLR

torch.optim.lr_scheduler.CosineAnnealingWarmRestarts

CosineAnnealingWarmRestarts

helios.scheduler.schedulers.CosineAnnealingRestartLR

CosineAnnealingRestartLR

helios.scheduler.schedulers.MultiStepRestartLR

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.nn.Module[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.