Table of Contents

Interface ICurriculumScheduler<T>

Namespace
AiDotNet.CurriculumLearning.Interfaces
Assembly
AiDotNet.dll

Interface for curriculum schedulers that control training progression.

public interface ICurriculumScheduler<T>

Type Parameters

T

The numeric type used for calculations.

Remarks

For Beginners: A curriculum scheduler decides when and how to introduce harder training samples. Think of it like a teacher who decides when students are ready to move from addition to multiplication.

Common Scheduling Strategies:

  • Linear: Increase data fraction steadily over epochs
  • Exponential: Start slow, then rapidly include more data
  • Step: Discrete jumps at fixed intervals
  • Self-paced: Adapt based on model's learning progress
  • Competence-based: Advance when model masters current content

Key Concepts:

  • Phase: A value in [0, 1] indicating curriculum progress
  • Data Fraction: Portion of training data available at current phase
  • Difficulty Threshold: Maximum difficulty of samples in current phase

Properties

CurrentEpoch

Gets the current epoch number.

int CurrentEpoch { get; }

Property Value

int

CurrentPhase

Gets the current phase (0 to 1).

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).

int CurrentPhaseNumber { get; }

Property Value

int

IsComplete

Gets whether the curriculum is complete (all samples available).

bool IsComplete { get; }

Property Value

bool

Name

Gets the name of the scheduler.

string Name { get; }

Property Value

string

TotalPhases

Gets the total number of phases in the curriculum.

int TotalPhases { get; }

Property Value

int

Methods

AdvancePhase()

Advances to the next phase.

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.

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.

T GetDataFraction()

Returns

T

Fraction of data to use (0 to 1).

GetDifficultyThreshold()

Gets the difficulty threshold for the current phase.

T GetDifficultyThreshold()

Returns

T

Maximum difficulty score allowed in current phase.

GetIndicesAtPhase(int[], int, T)

Gets the indices of samples available at a specific phase.

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 statistics about the scheduler's current state.

Dictionary<string, object> GetStatistics()

Returns

Dictionary<string, object>

Dictionary of statistics.

Reset()

Resets the scheduler to the initial phase.

void Reset()

StepEpoch(CurriculumEpochMetrics<T>)

Updates the scheduler after an epoch.

bool StepEpoch(CurriculumEpochMetrics<T> epochMetrics)

Parameters

epochMetrics CurriculumEpochMetrics<T>

Metrics from the completed epoch (loss, accuracy, etc.).

Returns

bool

True if the phase should advance, false otherwise.