PolynomialLRScheduler

Models & Types · AiDotNet.LearningRateSchedulers

Decays the learning rate using a polynomial function.

Inheritance: LearningRateSchedulerBase → PolynomialLRScheduler

For Beginners

This scheduler provides flexible control over how fast the learning rate decreases. With power=1, it’s a straight line decrease. With power=2, it decreases slowly at first then more rapidly. With power=0.5, it decreases rapidly at first then slows down. This flexibility lets you customize the decay curve to your specific training needs.

How It Works

PolynomialLR decays the learning rate from the initial value to a minimum value using a polynomial function. The decay curve can be controlled by the power parameter - power=1 gives linear decay, power>1 gives faster initial decay, power<1 gives slower initial decay.

Formula: lr = (base_lr - end_lr) * (1 - step/total_steps)^power + end_lr

Example

using AiDotNet.LearningRateSchedulers;
// Polynomial decay with power=2 (quadratic)
var scheduler = new PolynomialLRScheduler(
    baseLearningRate: 0.1,
    totalSteps: 100,
    power: 2.0,
    endLearningRate: 0.001
);

Constructors

Constructor Summary
PolynomialLRScheduler(double baseLearningRate, int totalSteps, double power, double endLearningRate) Initializes a new instance of the PolynomialLRScheduler class.

Properties

Property Summary
double EndLearningRate { get; } Gets the end learning rate.
double Power { get; } Gets the polynomial power.
int TotalSteps { get; } Gets the total number of steps.

Methods

Method Summary
Dictionary<string, object> GetState()