encoding.utils¶
Useful util functions.
Encoding Util Tools
LR_Scheduler¶
- class encoding.utils.LR_Scheduler(mode, base_lr, num_epochs, iters_per_epoch=0, lr_step=0, warmup_epochs=0, quiet=False)[source]¶
Learning Rate Scheduler
Step mode:
lr = baselr * 0.1 ^ {floor(epoch-1 / lr_step)}
Cosine mode:
lr = baselr * 0.5 * (1 + cos(iter/maxiter))
Poly mode:
lr = baselr * (1 - iter/maxiter) ^ 0.9
- Parameters
args –
args.lr_scheduler
lr scheduler mode (cos, poly),args.lr
base learning rate,args.epochs
number of epochs,args.lr_step
iters_per_epoch – number of iterations per epoch