Skip to content

csvance/onecycle-cosine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneCycleCosine

Implements the modified version of Leslie Smith's 1cycle policy described by Sylvain Gugger and Jeremy Howard for PyTorch. This version uses cosine annealing like the FastAI version but has three phases instead of two:

phase default description
warmup 30% lr_min -> lr_max, momentum_max -> momentum_min
plateau 0% lr_max, momentum_min - spends more time looking for an optimal minima.
winddown 70% lr_max -> lr_max / 24e4, momentum_min -> momentum_max

Phases 1 and 3 are the same as phases 1 and 2 FastAI 1cycle policy. Phase 2 is described in the FastAI blogpost.

Usage

  • OneCycleCosine should be used for optimizers which have a 'momentum' parameter
  • OneCycleCosineAdam should be used for Adam based optimizers which have a 'betas' parameter tuple

References

About

Cosine Annealed 1cycle Policy for PyTorch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages