Table of Contents

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

T

The 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

totalEpochs int

Total number of training epochs.

minFraction T

Initial data fraction (default 0.1).

maxFraction T

Final data fraction (default 1.0).

Properties

Name

Gets the name of this scheduler.

public override string Name { get; }

Property Value

string

Methods

GetDataFraction()

Gets the current data fraction using cosine annealing.

public override T GetDataFraction()

Returns

T