Table of Contents

Class ConstantLRScheduler

Namespace
AiDotNet.LearningRateSchedulers
Assembly
AiDotNet.dll

Maintains a constant learning rate throughout training.

public class ConstantLRScheduler : LearningRateSchedulerBase, ILearningRateScheduler
Inheritance
ConstantLRScheduler
Implements
Inherited Members

Examples

var scheduler = new ConstantLRScheduler(baseLearningRate: 0.001);

Remarks

ConstantLR simply returns the same learning rate for every step. While this is the simplest scheduler, it can be useful as a component in composite schedulers or for fine-tuning where you want to keep the learning rate fixed.

For Beginners: This is the simplest scheduler - it just keeps the learning rate the same throughout training. While adaptive schedules often work better, sometimes you want a fixed learning rate, especially for fine-tuning or when the learning rate has already been carefully tuned for your specific problem.

Constructors

ConstantLRScheduler(double)

Initializes a new instance of the ConstantLRScheduler class.

public ConstantLRScheduler(double baseLearningRate)

Parameters

baseLearningRate double

The constant learning rate to maintain.

Methods

ComputeLearningRate(int)

Computes the learning rate for a given step.

protected override double ComputeLearningRate(int step)

Parameters

step int

The step number.

Returns

double

The computed learning rate.