Class CosineScheduler<T>
- Namespace
- AiDotNet.CurriculumLearning.Schedulers
- Assembly
- AiDotNet.dll
Curriculum scheduler with cosine annealing curve.
public class CosineScheduler<T> : CurriculumSchedulerBase<T>, ICurriculumScheduler<T>
Type Parameters
TThe numeric type used for calculations.
- Inheritance
-
CosineScheduler<T>
- Implements
- Inherited Members
Remarks
For Beginners: This scheduler follows a cosine curve, providing smooth progression that starts slow, accelerates in the middle, and slows down again near the end. This can help with convergence stability.
Progression Pattern:
fraction = 0.5 * (1 - cos(π * progress))
Constructors
CosineScheduler(int, T?, T?)
Initializes a new instance of the CosineScheduler<T> class.
public CosineScheduler(int totalEpochs, T? minFraction = default, T? maxFraction = default)
Parameters
totalEpochsintTotal number of training epochs.
minFractionTInitial data fraction (default 0.1).
maxFractionTFinal data fraction (default 1.0).
Properties
Name
Gets the name of this scheduler.
public override string Name { get; }
Property Value
Methods
GetDataFraction()
Gets the current data fraction using cosine annealing.
public override T GetDataFraction()
Returns
- T