Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::LinearLRScheduler Class Referencefinalexport

Linear decay scheduler. More...

Inheritance diagram for Mila::Dnn::LinearLRScheduler:
Mila::Dnn::LearningRateScheduler

Public Member Functions

 LinearLRScheduler (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.

Detailed Description

Linear decay scheduler.

Linearly interpolates from initial_lr at step 0 to final_lr at total_steps. For steps >= total_steps the scheduler returns final_lr.

Preconditions:

  • total_steps > 0
  • initial_lr >= 0, final_lr >= 0

Member Function Documentation

◆ getLearningRate()

double Mila::Dnn::LinearLRScheduler::getLearningRate ( std::size_t step) const
inlineoverridevirtual

Get the learning rate for the provided (zero-based) step.

Parameters
stepZero-based step index.
Returns
Scalar learning rate to use at this step.

Implements Mila::Dnn::LearningRateScheduler.

◆ toString()

std::string Mila::Dnn::LinearLRScheduler::toString ( ) const
inlineoverridevirtual

Human-readable description of the scheduler.

Implements Mila::Dnn::LearningRateScheduler.


The documentation for this class was generated from the following file: