Table of Contents

Class EpochAdaptiveSamplerBase<T>

Namespace
AiDotNet.Data.Sampling
Assembly
AiDotNet.dll

Base class for epoch-adaptive samplers that change behavior over training epochs.

public abstract class EpochAdaptiveSamplerBase<T> : DataSamplerBase, IDataSampler

Type Parameters

T

The numeric type for scores/values.

Inheritance
EpochAdaptiveSamplerBase<T>
Implements
Derived
Inherited Members

Remarks

EpochAdaptiveSamplerBase is for samplers like curriculum learning and self-paced learning that adjust their sampling strategy based on the current epoch.

Constructors

EpochAdaptiveSamplerBase(int, int?)

Initializes a new instance of the EpochAdaptiveSamplerBase class.

protected EpochAdaptiveSamplerBase(int totalEpochs, int? seed = null)

Parameters

totalEpochs int

Total number of epochs for progression.

seed int?

Optional random seed for reproducibility.

Fields

NumOps

Numeric operations for type T.

protected static readonly INumericOperations<T> NumOps

Field Value

INumericOperations<T>

TotalEpochs

The total number of epochs for curriculum progression.

protected int TotalEpochs

Field Value

int

Properties

Progress

Gets the current progress through the curriculum (0.0 to 1.0).

protected double Progress { get; }

Property Value

double

Methods

OnEpochStart(int)

Called at the start of each epoch to allow the sampler to adjust its behavior.

public override void OnEpochStart(int epoch)

Parameters

epoch int

The current epoch number (0-based).

Remarks

This method allows samplers to implement epoch-dependent behavior such as: - Curriculum learning: adjusting difficulty thresholds as training progresses - Self-paced learning: updating sample inclusion thresholds - Active learning: refreshing uncertainty estimates

For Beginners: Some sampling strategies change over time. For example, curriculum learning starts with easy examples and gradually adds harder ones. This method tells the sampler "we're starting epoch N" so it can adjust accordingly.

OnEpochStartCore(int)

Called when a new epoch starts. Override to implement epoch-specific behavior.

protected virtual void OnEpochStartCore(int epoch)

Parameters

epoch int

The current epoch number (0-based).