IBatchSampler

Interfaces · AiDotNet.Interfaces

Extended interface for samplers that support batch-level sampling.

Implements: IDataSampler

Known implementations: BucketBatchSampler, DistributedBucketSampler, DynamicBatchSampler, StratifiedBatchSampler

How It Works

Some samplers need to operate at the batch level rather than sample level, for example to ensure each batch contains samples from all classes (stratified batching).

Properties

Property Summary
bool DropLast { get; set; } Gets or sets whether to drop the last incomplete batch.
int BatchSize { get; set; } Gets or sets the batch size for batch-level sampling.

Methods

Method Summary
IEnumerable<int[]> GetBatchIndices() Returns an enumerable of index arrays, where each array represents one batch.