Package ai.djl.training.dataset
Class DataIterable
- java.lang.Object
-
- ai.djl.training.dataset.DataIterable
-
public class DataIterable extends java.lang.Object implements java.lang.Iterable<Batch>, java.util.Iterator<Batch>
DataIterable is a data loader that combinesDataset,Batchifier,Pipeline, andSamplerto provide an iterable over the givenRandomAccessDataset.We don't recommended using DataIterable directly. Instead use
RandomAccessDatasetcombined withTrainerto iterate over theRandomAccessDataset}
-
-
Constructor Summary
Constructors Constructor Description DataIterable(RandomAccessDataset dataset, NDManager manager, Sampler sampler, Batchifier dataBatchifier, Batchifier labelBatchifier, Pipeline pipeline, Pipeline targetPipeline, java.util.concurrent.ExecutorService executor, int preFetchNumber, Device device)Creates a new instance ofDataIterablewith the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()java.util.Iterator<Batch>iterator()Batchnext()
-
-
-
Constructor Detail
-
DataIterable
public DataIterable(RandomAccessDataset dataset, NDManager manager, Sampler sampler, Batchifier dataBatchifier, Batchifier labelBatchifier, Pipeline pipeline, Pipeline targetPipeline, java.util.concurrent.ExecutorService executor, int preFetchNumber, Device device)
Creates a new instance ofDataIterablewith the given parameters.- Parameters:
dataset- the dataset to iterate onmanager- the manager to create the arrayssampler- a sampler to sample data withdataBatchifier- a batchifier for datalabelBatchifier- a batchifier for labelspipeline- the pipeline of transforms to apply on the datatargetPipeline- the pipeline of transforms to apply on the labelsexecutor- anExecutorServicepreFetchNumber- the number of samples to prefetchdevice- theDevice
-
-