ILearningRateScheduler

Interfaces · AiDotNet.LearningRateSchedulers

Interface for learning rate schedulers that adjust the learning rate during training.

Known implementations: LearningRateSchedulerBase

For Beginners

The learning rate controls how big each step is when the model is learning. A scheduler automatically adjusts this step size during training - typically starting with larger steps to make fast progress, then smaller steps to fine-tune the solution. Think of it like driving: you go faster on the highway (early training) and slow down as you approach your destination (later training).

How It Works

Learning rate schedulers are essential for training neural networks effectively. They adjust the learning rate according to various strategies, enabling better convergence and final performance.

Properties

Property Summary
double BaseLearningRate { get; } Gets the base (initial) learning rate.
double CurrentLearningRate { get; } Gets the current learning rate.
int CurrentStep { get; } Gets the current step (iteration or epoch count depending on scheduler type).

Methods

Method Summary
Dictionary<string, object> GetState() Gets the scheduler state for serialization/checkpointing.
double GetLearningRateAtStep(int step) Gets the learning rate for a specific step without advancing the scheduler.
double Step() Advances the scheduler by one step and returns the new learning rate.
double Step(double metric) Advances the scheduler using the epoch’s monitored metric, and returns the new learning rate.
void LoadState(Dictionary<string, object> state) Loads the scheduler state from a checkpoint.
void Reset() Resets the scheduler to its initial state.