Package ai.djl.training.dataset
Class RandomSampler
java.lang.Object
ai.djl.training.dataset.RandomSampler
- All Implemented Interfaces:
Sampler.SubSampler
RandomSampler is an implementation of the Sampler.SubSampler interface.
RandomSampler samples the data from [0, dataset.size) randomly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsample(RandomAccessDataset dataset) Fetches an iterator that iterates through the indices of the givenRandomAccessDataset.
-
Constructor Details
-
RandomSampler
public RandomSampler()
-
-
Method Details
-
sample
Fetches an iterator that iterates through the indices of the givenRandomAccessDataset.- Specified by:
samplein interfaceSampler.SubSampler- Parameters:
dataset- theRandomAccessDatasetto sample from- Returns:
- an iterator that iterates through the indices of the given
RandomAccessDataset
-