Schedulers#
KonfAI has two distinct scheduler families, resolved by different loaders.
Don’t confuse them. Use this page when filling in a schedulers: block — first
check which of the two blocks you are in, then pick a name from the matching
table.
A. Criterion-weight schedulers#
These schedule the weight of a loss over training, in the schedulers:
subtree of a criterion (konfai/metric/schedulers.py, base class Scheduler):
CrossEntropyLoss:
is_loss: true
schedulers:
Constant: { nb_step: 0, value: 1 }
Name |
Purpose |
Config args (defaults) |
|---|---|---|
|
Fixed weight for all iterations. |
|
|
Cosine anneal from |
|
Note
Each entry carries an nb_step (window width). Multiple schedulers can be
chained into consecutive iteration windows; an nb_step: 0 (or None)
window is the terminal, always-on schedule.
B. Learning-rate schedulers#
These schedule the optimizer learning rate, in the model’s schedulers:
block. The loader searches both torch.optim.lr_scheduler and
konfai.metric.schedulers, so you can use any torch scheduler (StepLR,
ReduceLROnPlateau, CosineAnnealingLR, …) plus the two KonfAI additions:
schedulers:
StepLR: { step_size: 20, gamma: 0.5 } # any torch LR scheduler works
Name |
Purpose |
Config args (defaults) |
|---|---|---|
|
Linear LR warmup wrapper ( |
|
|
nnU-Net-style polynomial LR decay |
|
Note
The optimizer itself is injected by the framework — you do not write it under
schedulers:.
Next steps#
Losses & metrics — where the weight schedulers live
Training configuration — the
optimizer:/schedulers:blocks