Skip to content

nexuml_library.training.schedulers.warmup_cosine

nexuml_library.training.schedulers.warmup_cosine

Learning-rate schedulers for NexuML library scenarios.

WarmupCosineLR

Bases: LRScheduler

Linear warmup followed by cosine decay to an absolute LR floor.

Parameters:

Name Type Description Default
optimizer Optimizer

Optimizer whose parameter groups will be scheduled.

required
warmup_epochs int

Number of initial epochs spent linearly increasing from min_lr to base_lr. Use 0 to disable warmup.

required
max_epochs int

Total scheduler horizon. At epoch == max_epochs the LR is min_lr.

required
min_lr float

Absolute minimum learning rate, not a multiplier.

required
last_epoch int

Last scheduler epoch, forwarded to PyTorch's scheduler base.

-1

get_lr

get_lr() -> list[float | torch.Tensor]

Return scheduled learning rates for the current epoch.