DataSamplerBase

Base Classes · AiDotNet.Data.Sampling

Base class for all data samplers providing common functionality.

Implements: IDataSampler

Known derived types: ActiveLearningSampler<T>, BucketBatchSampler, DistributedBucketSampler, DistributedSampler, DomainMixingSampler, DynamicBatchSampler, ElasticDistributedSampler, EpochAdaptiveSamplerBase<T>, ImportanceSampler<T>, RandomSampler, SequentialSampler, StratifiedBatchSampler, StratifiedSampler, SubsetSampler, WeightedSamplerBase<T>

For Beginners

This base class handles the common plumbing that all samplers need, like managing random number generators for reproducibility. When creating a custom sampler, inherit from this class and override GetIndicesCore().

How It Works

DataSamplerBase provides default implementations for common sampler operations like random seed management and epoch callbacks. All concrete samplers should inherit from this base class rather than implementing IDataSampler directly.

Properties

Property Summary
int Length { get; }

Methods

Method Summary
IEnumerable<int> GetIndices()
void OnEpochStart(int epoch)
void SetSeed(int seed)