timm
  • 🌍GET STARTED
    • Home
    • Quickstart
    • Installation
  • 🌍TUTORIALS
    • Using Pretrained Models as Feature Extractors
    • Training With The Official Training Script
    • Share and Load Models from the BOINC AI Hub
  • 🌍MODEL PAGES
    • Model Summaries
    • Results
    • Adversarial Inception v3
    • AdvProp (EfficientNet)
    • Big Transfer (BiT)
    • CSP-DarkNet
    • CSP-ResNet
    • CSP-ResNeXt
    • DenseNet
    • Deep Layer Aggregation
    • Dual Path NetwORK(DPN)
    • ECA-ResNet
    • EfficientNet
    • EfficientNet (Knapsack Pruned)
    • Ensemble Adversarial Inception ResNet v2
    • ESE-VoVNet
    • FBNet
    • (Gluon) Inception v3
    • (Gluon) ResNet
    • (Gluon) ResNeXt
    • (Gluon) SENet
    • (Gluon) SE-ResNeXt
    • (Gluon) Xception
    • HRNet
    • Instagram ResNeXt WSL
    • Inception ResNet v2
    • Inception v3
    • Inception v4
    • (Legacy) SE-ResNet
    • (Legacy) SE-ResNeXt
    • (Legacy) SENet
    • MixNet
    • MnasNet
    • MobileNet v2
    • MobileNet v3
    • NASNet
    • Noisy Student (EfficientNet)
    • PNASNet
    • RegNetX
    • RegNetY
    • Res2Net
    • Res2NeXt
    • ResNeSt
    • ResNet
    • ResNet-D
    • ResNeXt
    • RexNet
    • SE-ResNet
    • SelecSLS
    • SE-ResNeXt
    • SK-ResNet
    • SK-ResNeXt
    • SPNASNet
    • SSL ResNet
    • SWSL ResNet
    • SWSL ResNeXt
    • (Tensorflow) EfficientNet
    • (Tensorflow) EfficientNet CondConv
    • (Tensorflow) EfficientNet Lite
    • (Tensorflow) MobileNet v3
    • (Tensorflow) MixNet
    • (Tensorflow) MobileNet v3
    • TResNet
    • Wide ResNet
    • Xception
  • 🌍REFERENCE
    • Models
    • Data
    • Optimizers
    • Learning Rate Schedulers
Powered by GitBook
On this page
  • Learning Rate Schedulers
  • Schedulers
  1. REFERENCE

Learning Rate Schedulers

PreviousOptimizers

Last updated 1 year ago

Learning Rate Schedulers

This page contains the API reference documentation for learning rate schedulers included in timm.

Schedulers

Factory functions

timm.scheduler.create_scheduler

( argsoptimizer: Optimizerupdates_per_epoch: int = 0 )

timm.scheduler.create_scheduler_v2

( optimizer: Optimizersched: str = 'cosine'num_epochs: int = 300decay_epochs: int = 90decay_milestones: typing.List[int] = (90, 180, 270)cooldown_epochs: int = 0patience_epochs: int = 10decay_rate: float = 0.1min_lr: float = 0warmup_lr: float = 1e-05warmup_epochs: int = 0warmup_prefix: bool = Falsenoise: typing.Union[float, typing.List[float]] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42cycle_mul: float = 1.0cycle_decay: float = 0.1cycle_limit: int = 1k_decay: float = 1.0plateau_mode: str = 'max'step_on_epochs: bool = Trueupdates_per_epoch: int = 0 )

Scheduler Classes

class timm.scheduler.CosineLRScheduler

( optimizer: Optimizert_initial: intlr_min: float = 0.0cycle_mul: float = 1.0cycle_decay: float = 1.0cycle_limit: int = 1warmup_t = 0warmup_lr_init = 0warmup_prefix = Falset_in_epochs = Truenoise_range_t = Nonenoise_pct = 0.67noise_std = 1.0noise_seed = 42k_decay = 1.0initialize = True )

Cosine decay with restarts. This is described in the paper .

class timm.scheduler.MultiStepLRScheduler

( optimizer: Optimizerdecay_t: typing.List[int]decay_rate: float = 1.0warmup_t = 0warmup_lr_init = 0warmup_prefix = Truet_in_epochs = Truenoise_range_t = Nonenoise_pct = 0.67noise_std = 1.0noise_seed = 42initialize = True )

class timm.scheduler.PlateauLRScheduler

( optimizerdecay_rate = 0.1patience_t = 10verbose = Truethreshold = 0.0001cooldown_t = 0warmup_t = 0warmup_lr_init = 0lr_min = 0mode = 'max'noise_range_t = Nonenoise_type = 'normal'noise_pct = 0.67noise_std = 1.0noise_seed = Noneinitialize = True )

Decay the LR by a factor every time the validation loss plateaus.

class timm.scheduler.PolyLRScheduler

( optimizer: Optimizert_initial: intpower: float = 0.5lr_min: float = 0.0cycle_mul: float = 1.0cycle_decay: float = 1.0cycle_limit: int = 1warmup_t = 0warmup_lr_init = 0warmup_prefix = Falset_in_epochs = Truenoise_range_t = Nonenoise_pct = 0.67noise_std = 1.0noise_seed = 42k_decay = 1.0initialize = True )

Polynomial LR Scheduler w/ warmup, noise, and k-decay

class timm.scheduler.StepLRScheduler

( optimizer: Optimizerdecay_t: floatdecay_rate: float = 1.0warmup_t = 0warmup_lr_init = 0warmup_prefix = Truet_in_epochs = Truenoise_range_t = Nonenoise_pct = 0.67noise_std = 1.0noise_seed = 42initialize = True )

class timm.scheduler.TanhLRScheduler

( optimizer: Optimizert_initial: intlb: float = -7.0ub: float = 3.0lr_min: float = 0.0cycle_mul: float = 1.0cycle_decay: float = 1.0cycle_limit: int = 1warmup_t = 0warmup_lr_init = 0warmup_prefix = Falset_in_epochs = Truenoise_range_t = Nonenoise_pct = 0.67noise_std = 1.0noise_seed = 42initialize = True )

Inspiration from

k-decay option based on k-decay: A New Method For Learning Rate Schedule -

k-decay option based on k-decay: A New Method For Learning Rate Schedule -

Hyberbolic-Tangent decay with restarts. This is described in the paper

🌍
<source>
<source>
<source>
https://arxiv.org/abs/1608.03983
https://github.com/allenai/allennlp/blob/master/allennlp/training/learning_rate_schedulers/cosine.py
https://arxiv.org/abs/2004.05909
<source>
<source>
<source>
https://arxiv.org/abs/2004.05909
<source>
<source>
https://arxiv.org/abs/1806.01593