timm documentation
학습률 스케줄러
학습률 스케줄러
이 페이지에는 timm에 포함된 학습률 스케줄러의 API 참조 문서와 생성 및 스테핑 방식에 대한 개요가 포함되어 있습니다.
사용
Scheduler는 create_scheduler_v2를 사용하여 이름으로 생성되며, 이는 scheduler와 학습할 총 epoch 수(워밍업 프리픽스, 사이클 및 쿨다운 포함, 아래 참조)를 반환합니다. torch.optim.lr_scheduler와 달리 timm scheduler는 스텝을 자체적으로 카운트하지 않습니다. 이들은 무상태(stateless)로 설계되어 lr은 스케줄 구성과 명시적인 epoch 또는 업데이트 횟수의 함수이며, 실행을 재개하려면 epoch만 필요하고 체크포인트에 scheduler 상태가 저장되지 않습니다. 학습 루프는 epoch 또는 업데이트 횟수를 명시적으로 전달합니다:
- 각 epoch의 끝에서 다음 epoch의 인덱스(
epoch + 1)를 사용하여scheduler.step(epoch)를 호출합니다 - 각 옵티마이저 업데이트 후 지금까지의 업데이트 횟수를 인자로 전달하여
scheduler.step_update(num_updates)를 호출합니다
Scheduler는 epoch마다 또는 update마다(step_on_epochs) 단계가 진행되며, 다른 호출은 no-op이므로 학습 루프는 두 호출을 모두 수행하여 두 방식을 모두 지원할 수 있습니다.
import timm
from timm.optim import create_optimizer_v2
from timm.scheduler import create_scheduler_v2
model = timm.create_model('resnet50')
optimizer = create_optimizer_v2(model, opt='adamw', lr=1e-3, weight_decay=0.05)
updates_per_epoch = len(loader) # optimizer updates per epoch
# Cosine decay w/ 5 epochs of linear warmup, stepped per update for a smooth schedule.
scheduler, num_epochs = create_scheduler_v2(
optimizer,
sched='cosine',
num_epochs=100,
warmup_epochs=5,
min_lr=1e-6,
step_on_epochs=False,
updates_per_epoch=updates_per_epoch,
)
num_updates = 0
for epoch in range(num_epochs):
for batch in loader:
... # forward, backward, optimizer.step()
num_updates += 1
scheduler.step_update(num_updates=num_updates)
scheduler.step(epoch + 1) # pass the eval metric too for 'plateau', scheduler.step(epoch + 1, metric)기간(num_epochs, warmup_epochs, decay_epochs, …)은 항상 epoch 단위로 지정되며, step_on_epochs=False인 경우 팩토리가 이를 업데이트 단위로 변환합니다. 스케줄러는 클래스를 통해 직접 생성할 수도 있으며, 이 경우 기간은 스텝이 수행되는 단위(t_in_epochs)로 지정됩니다.
학습 스크립트(train.py)는 다음 플래그를 통해 팩토리 인수를 노출합니다:
--sched은 스케줄을 선택합니다.--epochs은 스케줄 길도를 설정합니다.--sched-on-updates를 사용하면 에포크가 아닌 업데이트마다 스텝을 계산합니다.--warmup-epochs는 warmup 기간을 설정합니다.--warmup-lr는 초기 warmup learning rate를 설정합니다.--warmup-prefix는 스케줄의 시작과 겹치지 않고 그 앞에 warmup을 추가합니다.--min-lr은 최소 학습률을 설정합니다.--decay-epochs는 WSD / rsqrt의 단계 감소 간격 또는 최종 감소 지속 시간을 설정합니다.--decay-milestones는 multistep 스케줄의 감쇠 에포크를 설정합니다.--decay-rate는 감쇠 계수, 즉 다항식 스케줄의 지수를 설정합니다.--cooldown-epochs은 스케줄이 종료된 후 최소 학습률로 에포크를 추가합니다.--patience-epochs는 plateau scheduler의 patience를 설정합니다.--lr-noise는 학습률 노이즈가 적용되는 스케줄 부분을 선택합니다.--lr-noise-pct은 노이즈 크기를 제한합니다.--lr-noise-std는 노이즈 표준편차를 설정합니다.--lr-cycle-mul은 사이클 길이 배수를 설정합니다.--lr-cycle-decay는 사이클 사이의 피크 학습률 배율을 설정합니다.--lr-cycle-limit은 사이클 수를 설정합니다.--lr-k-decay는 cosine / polynomial 스케줄의 k-decay를 설정합니다.--lr-decay-fn는 WSD / rsqrt의 최종 감쇠 함수를 선택합니다.--lr-stable-timescale는 rsqrt 안정 단계의 timescale을 설정합니다.
스케줄
sched | 클래스 | 일정 |
|---|---|---|
cosine | CosineLRScheduler | 기본 lr에서 min_lr까지의 Cosine annealing (SGDR), 선택적 재시작(사이클) 및 k-decay |
tanh | TanhLRScheduler | 쌍곡선 탄젠트 감쇠(논문), 선택적 재시작 |
poly | PolyLRScheduler | min_lr까지 다항 감쇠, 지수는 decay_rate로 지정되며, 선택적 재시작 및 k-감쇠 |
step | StepLRScheduler | decay_epochs마다 decay_rate를 곱한 lr |
multistep | MultiStepLRScheduler | decay_milestones 에포크 각각에서 decay_rate를 곱한 lr |
plateau | PlateauLRScheduler | 비추천. patience_epochs 동안 평가 지표가 개선되지 않으면 decay_rate을 곱한 lr, 에포크별 스테핑만 |
wsd | WSDLRScheduler | Warmup-stable-decay (MiniCPM), 일정 lr를 유지한 후 마지막 decay_epochs 동안 min_lr로 감쇠, 기본적으로 1-sqrt 감쇠 (paper) |
rsqrt | WSDLRScheduler | 마지막 decay_epochs 동안 선형 냉각을 적용하는 역제곱근 감쇠 (Big Vision) |
일반적인 옵션
- Warmup.
warmup_epochs에서 선형 warmup을warmup_lr로 진행하며, 모든 schedule에서 지원됩니다.warmup_prefix: 기본적으로 warmup은 스케줄의 시작 부분과 겹칩니다(스케줄은 epoch 0부터 계산되며, warmup이 첫 번째 epoch들을 대체합니다). 따라서num_epochs는 전체 길이를 나타냅니다.warmup_prefix=True인 경우 스케줄은 warmup 이후에 시작되며, warmup이 전체 길이에 추가됩니다.wsd와rsqrt의 경우 안정 단계는 항상 warmup 이후에 시작되며,warmup_prefix가 없으면 안정 단계와 감쇠 단계가num_epochs - warmup_epochs에 맞춰지며, 따라서num_epochs는 여전히 전체 에포크 수를 나타냅니다.
min_lr: 감쇠 스케줄(cosine,tanh,poly,wsd,rsqrt)이 종료 시점에 도달하는 lr이며,plateau의 하한입니다.
plateau 스케줄은 비추천(deprecated) 상태이며 향후 릴리스에서 제거될 예정입니다. 위 무상태(stateless) 설계에 적합하지 않았습니다. 학습률(lr)이 에포크가 아닌 평가 지표의 이력에 의존하기 때문이며, 해당 이력(최고 지표, patience 및 cooldown 카운터)은 체크포인트에 저장되지 않아 재개된 실행은 plateau 로직을 처음부터 다시 시작합니다. 체크포인트 지원은 추가되지 않을 예정입니다. 검증 plateau는 어닐링 시점에 대한 약한 신호이기도 합니다. cosine 또는 wsd와 같은 고정 스케줄은 재현 가능하고 정확히 재개되며, WSD 스윕(자세한 내용은 하이퍼파라미터 스윕 참조)은 하나의 안정적인 실행에서 여러 예산에 대한 cooldown을 비교합니다.
cooldown_epochs: 스케줄이 종료된 후min_lr에서 유지되는 epoch 수(cosine,tanh,poly,wsd,rsqrt), 반환되는num_epochs에 추가됩니다. 스케줄은 마지막 스텝 한 스텝 후에min_lr에 도달하므로, epoch 단위로 스텝을 진행할 때 cooldown epoch는min_lr에서 학습하는 방법이기도 합니다.- Cycles (
cosine,tanh,poly):cycle_limit > 1이면 스케줄이 재시작되며, 각 사이클은 이전 사이클보다cycle_mul배 더 길고, 피크 lr은 이전 사이클 대비cycle_decay배로 곱해집니다. 반환되는num_epochs는 모든 사이클을 포함합니다. k_decay(cosine,poly): k-decay는 감쇠의 형태(t ** k)를 변경하며,k > 1이면 학습률이 더 오래 높은 수준을 유지합니다.- Noise:
noise는num_epochs의 비율로 주어진 스케줄 범위(시작점 또는 시작점과 끝점)에 걸쳐 무작위 곱셈 lr 노이즈를 추가하며,noise_pct로 제한됩니다.
WSD와 rsqrt
WSDLRScheduler에는 세 가지 단계가 있습니다: 선형 워밍업, 안정 단계, 그리고 min_lr까지의 감쇠입니다.
decay_epochs은 최종 감쇠 기간을 설정합니다. 0과 1 사이의 값은 안정 구간 + 감쇠 구간 길이의 비율을 나타내며, 기본값은 20%입니다.decay_fn(--lr-decay-fn)은1-sqrt(wsd의 기본값),linear(rsqrt의 기본값),cosine,power또는exp를 선택합니다.stable_timescale(--lr-stable-timescale, epoch 단위)는 warmup 종료 시점부터(1 + t / timescale) ** -0.5로 감쇠하는rsqrt안정화 단계를 제어합니다. 기본값은 warmup 길이이며, warmup이 없는 경우 반드시 설정해야 합니다.
이 클래스는 일반화된 power 안정 단계와 사용자 정의 감쇠 함수도 지원합니다.
최종 anneal 단계에서 WSD 스케줄이 가장 큰 이점을 얻습니다. 따라서 decay 단계가 몇 epoch에 불과한 경우, 업데이트당 step(--sched-on-updates)을 사용하거나 cooldown epoch을 추가하세요. epoch 단위로 step을 진행할 경우, 짧은 decay의 마지막 epoch은 min_lr보다 눈에 띄게 높습니다(1-sqrt를 사용하는 5개 decay epoch 중 마지막 epoch의 경우, base lr의 약 10%).
# 300 epochs, 5 epoch warmup, constant lr, then a 1-sqrt decay over the final 20%
scheduler, num_epochs = create_scheduler_v2(
optimizer, sched='wsd', num_epochs=300, warmup_epochs=5, decay_epochs=0.2,
step_on_epochs=False, updates_per_epoch=updates_per_epoch,
)Parameter group lr 스케일
lr_scale 필드가 있는 파라미터 그룹(예: param_groups_layer_decay의 레이어별 lr 감쇠 그룹)의 경우, 스케줄된 lr이 해당 그룹의 scale 값과 곱해집니다. 스케줄러가 생성될 때 각 그룹의 기본 lr은 그룹의 initial_lr으로 기록됩니다.
재개
step counts가 전달되면, 재개된 실행을 위한 scheduler는 원래 실행과 동일한 방식으로 생성한 후 재개 지점까지 step을 진행하여 설정됩니다. scheduler.step(start_epoch) 또는 scheduler.step_update(start_epoch * updates_per_epoch)를 사용합니다. state_dict() / load_state_dict()는 scheduler의 속성을 저장하고 복원합니다.
API
팩토리 함수
timm.scheduler.create_scheduler_v2
< source >( optimizer: Optimizersched: str = 'cosine'num_epochs: int = 300decay_epochs: typing.Optional[float] = Nonedecay_milestones: typing.List[int] = (90, 180, 270)cooldown_epochs: int = 0patience_epochs: int = 10decay_rate: float = 0.1min_lr: float = 0.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.0decay_fn: typing.Optional[str] = Nonestable_timescale: typing.Optional[float] = Noneplateau_mode: str = 'max'step_on_epochs: bool = Trueupdates_per_epoch: int = 0 )
매개변수
- optimizer — 스케줄링할 optimizer
- sched — 스케줄러 이름. ‘cosine’, ‘tanh’, ‘step’, ‘multistep’, ‘poly’, ‘wsd’, ‘rsqrt’, ‘constant’, ‘plateau’ (비권장), 또는 스케줄러를 사용하지 않을 경우 ‘none’ (None을 반환하며 옵티마이저 lr은 변경되지 않음). ‘constant’는 warmup 이후 lr을 유지하되, 파라미터 그룹의 lr_scale(레이어별 lr 감쇠)을 적용합니다.
- num_epochs — 스케줄의 에포크 수(warmup_prefix가 있는 경우 warmup 제외, cooldown 제외)
- decay_epochs — lr 감쇠 간격(step) 또는 wsd / rsqrt의 감쇠 단계 길이(epoch). (0, 1) 범위의 값은 스케줄 길이의 비율을 나타냅니다. None = 90 (step), 0.2 (wsd / rsqrt)
- decay_milestones — lr을 감쇠할 epoch (multistep)
- cooldown_epochs — 스케줄이 종료된 후 lr을 min_lr로 유지할 epoch 수
- patience_epochs — lr 감쇠 전까지 개선이 없었던 epoch 수 (plateau, deprecated)
- decay_rate — lr 감쇠율(step, multistep, plateau), 다항식 지수(poly)
- min_lr — 해당 값까지 감소하는 스케줄러의 lr 하한
- warmup_lr — warmup 시작 시점의 lr
- warmup_epochs — 선형 워밍업에 사용할 에포크 수
- warmup_prefix — exclude the warmup period from num_epochs (added to the total), wsd / rsqrt are always warmup prefixed, with warmup_prefix=False their stable + decay phases fit within num_epochs
- noise — 스케줄 길이의 비율로 표현된 lr noise on / off 지점
- noise_pct — lr 노이즈 한도 백분율
- noise_std — lr noise 표준편차
- noise_seed — lr 노이즈 시드
- cycle_mul — 사이클 길이 배수 (cosine, tanh, poly)
- cycle_decay — 사이클당 lr 감쇠 (cosine, tanh, poly)
- cycle_limit — 사이클 수 (cosine, tanh, poly)
- k_decay — k-감쇠 (코사인, 다항)
- decay_fn — 감쇠 단계 함수 (wsd / rsqrt), None = wsd의 경우 ‘1-sqrt’, rsqrt의 경우 ‘linear’
- stable_timescale — 에포크 단위의 rsqrt timescale (rsqrt), None = warmup_epochs
- plateau_mode — ‘max’ 또는 ‘min’, 지표 방향(plateau)
- step_on_epochs — 에포드별로 스케줄을 진행하며, 그렇지 않으면 업데이트별로 진행합니다(updates_per_epoch 필요)
- updates_per_epoch — 에포크당 옵티마이저 업데이트 횟수 (step_on_epochs=False)
이름으로 학습률 스케줄러를 생성합니다.
Scheduler 클래스
class timm.scheduler.CosineLRScheduler
< source >( optimizer: Optimizert_initial: intlr_min: float = 0.0cycle_mul: float = 1.0cycle_decay: float = 1.0cycle_limit: int = 1warmup_t: int = 0warmup_lr_init: float = 0.0warmup_prefix: bool = Falset_in_epochs: bool = Truenoise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42k_decay: float = 1.0initialize: bool = True )
리스타트를 사용하는 코사인 감쇠. 이는 논문 https://arxiv.org/abs/1608.03983에 설명되어 있습니다.
https://github.com/allenai/allennlp/blob/master/allennlp/training/learning_rate_schedulers/cosine.py에서 영감을 받았습니다
k-decay: A New Method For Learning Rate Schedule에 기반한 k-decay 옵션 - https://arxiv.org/abs/2004.05909
class timm.scheduler.MultiStepLRScheduler
< source >( optimizer: Optimizerdecay_t: typing.List[int]decay_rate: float = 1.0warmup_t: int = 0warmup_lr_init: float = 0.0warmup_prefix: bool = Truet_in_epochs: bool = Truenoise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42initialize: bool = True )
워밍업과 노이즈가 포함된 다단계 학습률 스케줄
Warmup 구간을 제외하고, decay 마일스톤은 t + 1과 비교됩니다. 여기서 t는 warmup_prefix=True인 경우 warmup을 제외합니다. 예를 들어, warmup이 없는 경우 마일스톤 10은 스케줄 인덱스 9에서 적용됩니다.
이 오랜 관행은 PyTorch의 MultiStepLR과 다르며, 기존 학습 일정과의 호환성을 위해 유지됩니다.
class timm.scheduler.PlateauLRScheduler
< source >( optimizer: Optimizerdecay_rate: float = 0.1patience_t: int = 10threshold: float = 0.0001cooldown_t: int = 0warmup_t: int = 0warmup_lr_init: float = 0.0lr_min: float = 0.0mode: str = 'max'noise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_type: str = 'normal'noise_pct: float = 0.67noise_std: float = 1.0noise_seed: typing.Optional[int] = Noneinitialize: bool = True )
validation loss가 더 이상 감소하지 않을 때마다 LR을 특정 계수로 감소시킵니다.
Deprecated: 이 스케줄러는 향후 릴리스에서 제거될 예정입니다. timm 스케줄러는 에포크 또는 업데이트 횟수의 무상태(stateless) 함수로 설계되어 있으며, 이 지표 기반 스케줄은 그러한 형태가 아니었습니다. 해당 상태(최고 지표, patience 및 cooldown 카운터)는 학습 체크포인트에 저장되지 않으므로, 재개된 실행은 plateau 로직을 처음부터 다시 시작하며, 체크포인트 지원은 추가되지 않을 것입니다. cosine 또는 wsd와 같은 고정 스케줄을 사용하는 것이 좋습니다. sweep.py의 WSD cooldown 분기는 재현 가능한 스케줄로 여러 예산에서 어닐링을 비교합니다.
class timm.scheduler.PolyLRScheduler
< source >( optimizer: Optimizert_initial: intpower: float = 0.5lr_min: float = 0.0cycle_mul: float = 1.0cycle_decay: float = 1.0cycle_limit: int = 1warmup_t: int = 0warmup_lr_init: float = 0.0warmup_prefix: bool = Falset_in_epochs: bool = Truenoise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42k_decay: float = 1.0initialize: bool = True )
워밍업, 노이즈 및 k-감쇠가 포함된 다항식 LR 스케줄러
k-decay: A New Method For Learning Rate Schedule에 기반한 k-decay 옵션 - https://arxiv.org/abs/2004.05909
class timm.scheduler.StepLRScheduler
< source >( optimizer: Optimizerdecay_t: floatdecay_rate: float = 1.0warmup_t: int = 0warmup_lr_init: float = 0.0warmup_prefix: bool = Truet_in_epochs: bool = Truenoise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42initialize: bool = True )
class timm.scheduler.TanhLRScheduler
< source >( 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: int = 0warmup_lr_init: float = 0.0warmup_prefix: bool = Falset_in_epochs: bool = Truenoise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42initialize: bool = True )
재시작이 포함된 하이퍼볼릭 탄젠트 감쇠. 이는 https://arxiv.org/abs/1806.01593 논문에서 설명되어 있습니다.
class timm.scheduler.WSDLRScheduler
< source >( optimizer: Optimizert_initial: intdecay_t: intlr_min: float = 0.0stable_fn: str = 'constant'stable_timescale: typing.Optional[float] = Nonestable_power: float = 0.5decay_fn: typing.Union[str, typing.Callable[[float], float]] = '1-sqrt'decay_power: float = 0.5decay_ratio: float = 0.1warmup_t: int = 0warmup_lr_init: float = 0.0t_in_epochs: bool = Truenoise_range_t: typing.Union[typing.List[int], typing.Tuple[int, int], int, NoneType] = Nonenoise_pct: float = 0.67noise_std: float = 1.0noise_seed: int = 42initialize: bool = True )
매개변수
- optimizer — 스케줄링할 optimizer
- t_initial — 안정화 + 감쇠 단계의 길이(에포크 또는 업데이트,
t_in_epochs참조) - decay_t — 감쇠 단계의 길이,
t_initial의 마지막decay_t단계 - lr_min — 감쇠 단계 끝에서의 lr
- stable_fn — 안정 단계 함수, ‘constant’, ‘rsqrt’, ‘power’ 중 하나
- stable_timescale — ‘rsqrt’ / ‘power’ 안정 함수의 timescale이며, 기본값은
warmup_t입니다 - stable_power — ‘power’ 안정 함수의 지수
- decay_fn — 감쇠 단계 함수. ‘linear’, ‘1-sqrt’, ‘cosine’, ‘power’, ‘exp’ 중 하나이거나 callable
- decay_power — ‘power’ 감쇠 함수의 지수
- decay_ratio — 정규화 전 ‘exp’ 감쇠 함수의 최종 비율
- warmup_t — warmup 길이,
t_initial의 접두사 - warmup_lr_init — warmup 시작 시점의 lr
- t_in_epochs —
t은 epoch 단위(step())이며, 그렇지 않으면 업데이트 단위(step_update())입니다. - noise_range_t — lr noise 범위,
Scheduler참고 - noise_pct — lr 노이즈 한도 백분율
- noise_std — lr noise 표준편차
- noise_seed — lr 노이즈 시드
- initialize — 현재 lr에서
initial_lr파라미터 그룹 필드를 초기화
선택 가능한 안정 및 감쇠 함수를 갖춘 Warmup-Stable-Decay(WSD) LR 스케줄.
세 가지 단계: warmup_t 단계에 걸친 선형 워밍업, 안정 단계, 그리고 마지막 decay_t 단계에 걸쳐 lr_min으로 감쇠하는 단계입니다. t_initial은 안정 단계와 감쇠 단계의 길이를 나타내며, 워밍업은 항상 접두사로 존재하므로 스케줄의 총 길이는 warmup_t + t_initial입니다(get_cycle_length() 참조). 이후에는 lr_min이 유지됩니다.
NOTE: 다른 스케줄러와 마찬가지로 lr_min은 t = warmup_t + t_initial에서 도달하며, 이는 마지막 스케줄링 단계보다 한 단계 늦은 시점입니다. 따라서 마지막 스케줄링 단계는 lr_min까지 한 단계의 감쇠가 부족합니다. 에포크마다 단계별로 진행하는 짧은 감쇠 단계에서는 이것이 중요한 차이로 이어집니다(예: ‘1-sqrt’의 5개 감쇠 에포크 중 마지막은 안정된 lr의 약 10% 수준). 최종 어닐링은 WSD에서 중요하므로, 업데이트마다 단계별로 진행(t_in_epochs=False, train.py에서 --sched-on-updates)하거나 쿨다운 에포크를 추가(lr_min에서 유지, --cooldown-epochs)하는 것이 좋습니다.
안정 함수는 워밍업 종료 이후 경과 시간(t_s)에 대해 평가되며 t_s = 0에서 1이므로, 워밍업은 항상 기본 lr에서 인계됩니다. 감쇠 함수는 [0, 1] 범위의 감쇠 진행률 frac을 1에서 0까지의 계수로 매핑하여 안정 값에 곱하므로, 감쇠하는 안정 함수는 감쇠 단계에서도 계속 감쇠합니다(Big Vision rsqrt + linear cooldown 스케줄과 동일).
lr(t) = lr_min + (base_lr stable(t_s) - lr_min) decay(frac)
안정적인 함수:
constant: 1, WSD 스케줄rsqrt: (1 + t_s / timescale) ** -0.5,stable_timescale == warmup_t(기본값)일 때 Big Vision 역제곱근 스케줄power: (1 + t_s / timescale) ** -stable_power, rsqrt 일반화 (Power 스케줄러)
감쇠 함수:
1-sqrt: 1 - sqrt(frac), https://arxiv.org/abs/2405.18392에서 가장 높은 성능을 보인 cooldown (기본값)linear: 1 - frac, ‘trapezoidal’ 스케줄 및 Big Vision cooldowncosine: 0.5 (1 + cos(pi frac))power: 1 - frac ** decay_power, 0.5 == ‘1-sqrt’, 1.0 == ‘linear’, 2.0은 ‘square’ decayexp: 안정 값의decay_ratio비율까지 지수적으로 감쇠하며, lr_min에 도달하도록 정규화- 기타 모든 경우를 위한
fn(frac) -> factor콜러블