Skip to content

Schedule

samudra.utils.schedule

CosineSchedulerConfig

Bases: BaseModel

Cosine scheduler; see pytorch CosineAnnealingLR.

CosineWithTailSchedulerConfig

Bases: BaseModel

Cosine scheduler which goes to tail_lr for the last tail_epochs.

CosineWithWarmupConfig

Bases: BaseModel

Cosine scheduler which goes from warmup_lr to the default lr for the first warmup_epochs.

LinearCooldownSchedulerConfig

Bases: BaseModel

Reduce LR to final_lr over the supplied number of optimizer/epoch steps.

The first step already decreases LR; the last step uses final_lr. The caller chooses the unit, as for the other scheduler configs, and calls step() after each optimizer update (or epoch) to prepare the next learning rate.