Table of Contents

Class CompetenceBasedScheduler<T>

Namespace
AiDotNet.CurriculumLearning.Schedulers
Assembly
AiDotNet.dll

Curriculum scheduler that advances based on model competence/mastery.

public class CompetenceBasedScheduler<T> : CurriculumSchedulerBase<T>, ICompetenceBasedScheduler<T>, ICurriculumScheduler<T>

Type Parameters

T

The numeric type used for calculations.

Inheritance
CompetenceBasedScheduler<T>
Implements
Inherited Members

Remarks

For Beginners: This scheduler tracks how well the model is learning and only advances to harder content when the model has "mastered" the current difficulty level. Think of it like a tutor who won't move to harder problems until you've shown you understand the current ones.

How It Works:

  1. Monitor model performance metrics (accuracy, loss improvement)
  2. Compute a competence score based on these metrics
  3. When competence exceeds threshold, advance to next phase
  4. Include more difficult samples in each subsequent phase

Competence Metrics:

  • Accuracy-Based: Uses validation/training accuracy as competence
  • Loss-Based: Uses loss reduction rate as competence indicator
  • Plateau-Based: Advances when loss stops improving (mastery plateau)
  • Combined: Weighted combination of multiple metrics

References:

  • Platanios et al. "Competence-based Curriculum Learning" (NAACL 2019)

Constructors

CompetenceBasedScheduler(int, T?, CompetenceMetricType, int, T?, T?, T?, T?, int?)

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

public CompetenceBasedScheduler(int totalEpochs, T? competenceThreshold = default, CompetenceMetricType metricType = CompetenceMetricType.Combined, int patienceEpochs = 5, T? minImprovement = default, T? smoothingFactor = default, T? minFraction = default, T? maxFraction = default, int? totalPhases = null)

Parameters

totalEpochs int

Total number of training epochs.

competenceThreshold T

Threshold to advance to next phase (default 0.9).

metricType CompetenceMetricType

Type of competence metric to use.

patienceEpochs int

Epochs without improvement before advancing (for plateau mode).

minImprovement T

Minimum improvement to reset patience counter.

smoothingFactor T

Exponential smoothing factor for competence updates.

minFraction T

Initial data fraction (default 0.1).

maxFraction T

Final data fraction (default 1.0).

totalPhases int?

Number of curriculum phases.

Properties

CompetenceThreshold

Gets or sets the competence threshold required to advance phases.

public T CompetenceThreshold { get; set; }

Property Value

T

Remarks

When the model's competence exceeds this threshold, it is considered to have mastered the current content and will advance to the next phase.

CurrentCompetence

Gets the current competence level of the model.

public T CurrentCompetence { get; }

Property Value

T

Remarks

Competence is a value typically between 0 and 1, where higher values indicate better mastery of the current curriculum content.

Name

Gets the name of this scheduler.

public override string Name { get; }

Property Value

string

Methods

GetDataFraction()

Gets the current data fraction based on competence-driven phase.

public override T GetDataFraction()

Returns

T

GetStatistics()

Gets scheduler-specific statistics.

public override Dictionary<string, object> GetStatistics()

Returns

Dictionary<string, object>

HasMasteredCurrentContent()

Gets whether the model has mastered the current curriculum content.

public bool HasMasteredCurrentContent()

Returns

bool

True if competence exceeds threshold, false otherwise.

Reset()

Resets the scheduler to initial state.

public override void Reset()

StepEpoch(CurriculumEpochMetrics<T>)

Updates the scheduler after an epoch, potentially advancing phases.

public override bool StepEpoch(CurriculumEpochMetrics<T> epochMetrics)

Parameters

epochMetrics CurriculumEpochMetrics<T>

Metrics from the completed epoch.

Returns

bool

True if the phase advanced, false otherwise.

UpdateCompetence(CurriculumEpochMetrics<T>)

Updates the competence estimate based on model performance.

public void UpdateCompetence(CurriculumEpochMetrics<T> metrics)

Parameters

metrics CurriculumEpochMetrics<T>

Performance metrics from current epoch.

Remarks

The competence update strategy depends on the configured metric type:

  • Accuracy-based: Uses validation accuracy directly
  • Loss-based: Converts loss improvement to competence
  • Plateau-based: Tracks epochs without improvement
  • Combined: Weighted average of multiple metrics