Class SequentialSampler
A sampler that returns indices in sequential order without shuffling.
public class SequentialSampler : DataSamplerBase, IDataSampler
- Inheritance
-
SequentialSampler
- Implements
- Inherited Members
Remarks
SequentialSampler is useful during evaluation/inference when you want deterministic, reproducible results without any randomness.
For Beginners: This sampler goes through your data in order (0, 1, 2, 3, ...). Use this when: - Evaluating your model (you want consistent results) - Making predictions on new data - Debugging to isolate issues from randomness
Constructors
SequentialSampler(int)
Initializes a new instance of the SequentialSampler class.
public SequentialSampler(int datasetSize)
Parameters
datasetSizeintThe total number of samples in the dataset.
Exceptions
- ArgumentOutOfRangeException
Thrown when datasetSize is less than 1.
Properties
Length
Gets the total number of samples this sampler will produce per epoch.
public override int Length { get; }
Property Value
Remarks
This may differ from the dataset size for oversampling or undersampling strategies.
Methods
GetIndicesCore()
Core implementation for generating indices. Override this in derived classes.
protected override IEnumerable<int> GetIndicesCore()
Returns
- IEnumerable<int>
An enumerable of sample indices.