aiaccel.torch.lightning.LRSchedulerConfig¶
- class aiaccel.torch.lightning.LRSchedulerConfig(scheduler_generator: Callable[[...], LRScheduler], interval: str = 'step', frequency: int = 1, monitor: str | None = 'validation/loss', strict: bool = True, name: str | None = None)[source]¶
Configuration for a learning rate scheduler in Lightning.
- Parameters:
scheduler_generator (Callable[..., optim.lr_scheduler.LRScheduler]) – A callable that generates the scheduler.
interval (str) – Timing to call
scheduler.step("step"or"epoch"). Defaults to"step".frequency (int) – How often to call the scheduler. Defaults to
1.monitor (str | None) – Metric to monitor (required for
ReduceLROnPlateau). Defaults to"validation/loss".strict (bool | None) – Whether to raise if
monitoris missing. Mirrors Lightning’sstrictflag.name (str | None) – Optional name for logging. Defaults to
None.
- __init__(scheduler_generator: Callable[[...], LRScheduler], interval: str = 'step', frequency: int = 1, monitor: str | None = 'validation/loss', strict: bool = True, name: str | None = None) None¶
Methods
__init__(scheduler_generator[, interval, ...])build(optimizer)Attributes
frequencyintervalmonitornamestrictscheduler_generator