vis4d.engine.optim¶
Optimizer modules.
- class ConstantLR(optimizer, max_steps, factor=0.3333333333333333, last_epoch=-1)[source]¶
Constant learning rate scheduler.
- Parameters:
optimizer (Optimizer) – Wrapped optimizer.
max_steps (int) – Maximum number of steps.
factor (float) – Scale factor. Default: 1.0 / 3.0.
last_epoch (int) – The index of last epoch. Default: -1.
Initialize ConstantLR.
- class LRSchedulerWrapper(lr_schedulers_cfg, optimizer, steps_per_epoch=-1)[source]¶
LR scheduler wrapper.
Initialize LRSchedulerWrapper.
- class PolyLR(optimizer, max_steps, power=1.0, min_lr=0.0, last_epoch=-1)[source]¶
Polynomial learning rate decay.
Example
Assuming lr = 0.001, max_steps = 4, min_lr = 0.0, and power = 1.0, the learning rate will be: lr = 0.001 if step == 0 lr = 0.00075 if step == 1 lr = 0.00050 if step == 2 lr = 0.00025 if step == 3 lr = 0.0 if step >= 4
- Parameters:
optimizer (Optimizer) – Wrapped optimizer.
max_steps (int) – Maximum number of steps.
power (float, optional) – Power factor. Default: 1.0.
min_lr (float) – Minimum learning rate. Default: 0.0.
last_epoch (int) – The index of last epoch. Default: -1.
Initialize PolyLRScheduler.
- class QuadraticLRWarmup(optimizer, max_steps, last_epoch=-1)[source]¶
Quadratic learning rate warmup.
- Parameters:
optimizer (Optimizer) – Wrapped optimizer.
max_steps (int) – Maximum number of steps.
last_epoch (int) – The index of last epoch. Default: -1.
Initialize QuadraticLRWarmup.
- set_up_optimizers(optimizers_cfg, models, steps_per_epoch=-1)[source]¶
Set up optimizers.
- Return type:
tuple
[list
[Optimizer
],list
[LRSchedulerWrapper
]]
Modules
Optimizer. |
|
LR schedulers. |