SelfPacedSampler<T>

Models & Types · AiDotNet.Data.Sampling

A sampler that implements self-paced learning with automatic difficulty adjustment.

Inheritance: DataSamplerBase → EpochAdaptiveSamplerBase<T> → SelfPacedSampler<T>

For Beginners

Unlike CurriculumSampler where YOU define difficulty, SelfPacedSampler lets the MODEL decide what’s easy based on its own performance:

  • Samples with low loss = easy = selected early
  • Samples with high loss = hard = selected later

This is adaptive curriculum learning - the curriculum adjusts based on the model!

How It Works

SelfPacedSampler automatically adjusts sample selection based on the model’s performance on each sample. Samples with lower loss (easier for the model) are more likely to be selected early, with harder samples gradually introduced.

Constructors

Constructor Summary
SelfPacedSampler(int datasetSize, T initialLambda, T lambdaGrowthRate, int totalEpochs, int? seed) Initializes a new instance of the SelfPacedSampler class.

Properties

Property Summary
T Lambda { get; } Gets the current pace parameter lambda.
int Length { get; }

Methods

Method Summary
void UpdateLoss(int index, T loss) Updates the loss for a specific sample.
void UpdateLosses(IReadOnlyList<int> indices, IReadOnlyList<T> losses) Batch updates losses for multiple samples.