Table of Contents

Class CurriculumSchedulerBase<T>

Namespace
AiDotNet.CurriculumLearning.Schedulers
Assembly
AiDotNet.dll

Abstract base class for curriculum schedulers providing common functionality.

public abstract class CurriculumSchedulerBase<T> : ICurriculumScheduler<T>

Type Parameters

T

The numeric type used for calculations.

Inheritance
CurriculumSchedulerBase<T>
Implements
Derived
Inherited Members

Remarks

For Beginners: A curriculum scheduler determines how the training curriculum progresses over time. It controls when and how many samples are included in training as the model advances through the curriculum.

Core Responsibilities:

  • Track current training progress (epoch, phase)
  • Calculate data fraction to use at each training stage
  • Select samples based on difficulty scores and current progress
  • Determine when curriculum is complete

Common Scheduler Types:

  • Linear: Constant rate of curriculum progression
  • Exponential: Starts slow, accelerates progression
  • Step: Discrete jumps in curriculum phases
  • Self-Paced: Adapts based on model performance
  • Competence-Based: Advances when model masters current content

Constructors

CurriculumSchedulerBase(int, T?, T?, int?)

Initializes a new instance of the CurriculumSchedulerBase<T> class.

protected CurriculumSchedulerBase(int totalEpochs, T? minFraction = default, T? maxFraction = default, int? totalPhases = null)

Parameters

totalEpochs int

Total number of training epochs.

minFraction T

Minimum data fraction to start with (default 0.1).

maxFraction T

Maximum data fraction to end with (default 1.0).

totalPhases int?

Total number of curriculum phases (default matches epochs).

Fields

NumOps

Numeric operations for type T.

protected static readonly INumericOperations<T> NumOps

Field Value

INumericOperations<T>

Properties

CurrentEpoch

Gets the current epoch number.

public int CurrentEpoch { get; protected set; }

Property Value

int

CurrentPhase

Gets the current phase as a value between 0 and 1.

public virtual T CurrentPhase { get; }

Property Value

T

Remarks

Phase 0 means only easiest samples are available. Phase 1 means all samples are available.

CurrentPhaseNumber

Gets the current phase number (0-indexed).

public virtual int CurrentPhaseNumber { get; }

Property Value

int

IsComplete

Gets whether the curriculum has completed (all samples available).

public virtual bool IsComplete { get; }

Property Value

bool

MaxFraction

Maximum data fraction to end with (usually 1.0).

protected T MaxFraction { get; }

Property Value

T

MinFraction

Minimum data fraction to start with.

protected T MinFraction { get; }

Property Value

T

Name

Gets the name of this scheduler.

public abstract string Name { get; }

Property Value

string

TotalEpochs

Total number of epochs for training.

protected int TotalEpochs { get; }

Property Value

int

TotalPhases

Gets the total number of phases in the curriculum.

public virtual int TotalPhases { get; }

Property Value

int

Methods

AdvancePhase()

Advances to the next phase.

public virtual bool AdvancePhase()

Returns

bool

True if advanced, false if already at final phase.

GetCurrentIndices(int[], int)

Gets the indices of samples available at the current phase.

public virtual int[] GetCurrentIndices(int[] sortedIndices, int totalSamples)

Parameters

sortedIndices int[]

Indices sorted by difficulty (easy to hard).

totalSamples int

Total number of samples.

Returns

int[]

Indices of samples available for training.

GetDataFraction()

Gets the data fraction available at the current phase.

public abstract T GetDataFraction()

Returns

T

Fraction of data to use (0 to 1).

GetDifficultyThreshold()

Gets the difficulty threshold for the current phase.

public virtual T GetDifficultyThreshold()

Returns

T

Maximum difficulty score allowed in current phase.

Remarks

Default implementation returns the data fraction as the threshold, meaning samples with normalized difficulty below this value are included.

GetIndicesAtPhase(int[], int, T)

Gets the indices of samples available at a specific phase.

public virtual int[] GetIndicesAtPhase(int[] sortedIndices, int totalSamples, T phase)

Parameters

sortedIndices int[]

Indices sorted by difficulty (easy to hard).

totalSamples int

Total number of samples.

phase T

The phase to get indices for (0 to 1).

Returns

int[]

Indices of samples available at the specified phase.

GetStatistics()

Gets scheduler-specific statistics.

public virtual Dictionary<string, object> GetStatistics()

Returns

Dictionary<string, object>

Dictionary of statistics about the scheduler state.

InterpolateFraction(T)

Interpolates between min and max fraction based on progress.

protected T InterpolateFraction(T t)

Parameters

t T

Interpolation parameter [0, 1].

Returns

T

Interpolated fraction.

Reset()

Resets the scheduler to the initial phase.

public virtual void Reset()

StepEpoch(CurriculumEpochMetrics<T>)

Updates the scheduler after an epoch.

public virtual bool StepEpoch(CurriculumEpochMetrics<T> epochMetrics)

Parameters

epochMetrics CurriculumEpochMetrics<T>

Metrics from the completed epoch.

Returns

bool

True if the phase should advance, false otherwise.