mmcls.core.CosineAnnealingCooldownLrUpdaterHook¶
- class mmcls.core.CosineAnnealingCooldownLrUpdaterHook(min_lr=None, min_lr_ratio=None, cool_down_ratio=0.1, cool_down_time=10, **kwargs)[source]¶
Cosine annealing learning rate scheduler with cooldown.
- Parameters
min_lr (float, optional) – The minimum learning rate after annealing. Defaults to None.
min_lr_ratio (float, optional) – The minimum learning ratio after nnealing. Defaults to None.
cool_down_ratio (float) – The cooldown ratio. Defaults to 0.1.
cool_down_time (int) – The cooldown time. Defaults to 10.
by_epoch (bool) – If True, the learning rate changes epoch by epoch. If False, the learning rate changes iter by iter. Defaults to True.
warmup (string, optional) – Type of warmup used. It can be None (use no warmup), ‘constant’, ‘linear’ or ‘exp’. Defaults to None.
warmup_iters (int) – The number of iterations or epochs that warmup lasts. Defaults to 0.
warmup_ratio (float) – LR used at the beginning of warmup equals to
warmup_ratio * initial_lr. Defaults to 0.1.warmup_by_epoch (bool) – If True, the
warmup_itersmeans the number of epochs that warmup lasts, otherwise means the number of iteration that warmup lasts. Defaults to False.
Note
You need to set one and only one of
min_lrandmin_lr_ratio.