|
Mila 0.13.48
Deep Neural Network Library
|
Cosine annealing scheduler. More...


Public Member Functions | |
| CosineLRScheduler (double initial_lr, double final_lr, std::size_t total_steps) | |
| double | getLearningRate (std::size_t step) const override |
| Get the learning rate for the provided (zero-based) step. | |
| std::string | toString () const override |
| Human-readable description of the scheduler. | |
| Public Member Functions inherited from Mila::Dnn::LearningRateScheduler | |
| virtual | ~LearningRateScheduler ()=default |
Private Attributes | |
| double | final_lr_ |
| double | initial_lr_ |
| std::size_t | total_steps_ |
Cosine annealing scheduler.
Uses cosine schedule from initial_lr to final_lr over total_steps. For step >= total_steps the scheduler returns final_lr.
Formula (t in [0,1]): lr = final + 0.5*(initial - final)*(1 + cos(pi * t))
Preconditions:
|
inline |
|
inlineoverridevirtual |
Get the learning rate for the provided (zero-based) step.
| step | Zero-based step index. |
Implements Mila::Dnn::LearningRateScheduler.
|
inlineoverridevirtual |
Human-readable description of the scheduler.
Implements Mila::Dnn::LearningRateScheduler.
|
private |
|
private |
|
private |