Interface ILearningRateScheduler
- Namespace
- AiDotNet.LearningRateSchedulers
- Assembly
- AiDotNet.dll
Interface for learning rate schedulers that adjust the learning rate during training.
public interface ILearningRateScheduler
Remarks
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.
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).
Properties
BaseLearningRate
Gets the base (initial) learning rate.
double BaseLearningRate { get; }
Property Value
CurrentLearningRate
Gets the current learning rate.
double CurrentLearningRate { get; }
Property Value
CurrentStep
Gets the current step (iteration or epoch count depending on scheduler type).
int CurrentStep { get; }
Property Value
Methods
GetLearningRateAtStep(int)
Gets the learning rate for a specific step without advancing the scheduler.
double GetLearningRateAtStep(int step)
Parameters
stepintThe step number to get the learning rate for.
Returns
- double
The learning rate at the specified step.
GetState()
Gets the scheduler state for serialization/checkpointing.
Dictionary<string, object> GetState()
Returns
- Dictionary<string, object>
A dictionary containing the scheduler state.
LoadState(Dictionary<string, object>)
Loads the scheduler state from a checkpoint.
void LoadState(Dictionary<string, object> state)
Parameters
stateDictionary<string, object>The state dictionary to load from.
Reset()
Resets the scheduler to its initial state.
void Reset()
Step()
Advances the scheduler by one step and returns the new learning rate.
double Step()
Returns
- double
The updated learning rate for the next step.