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
, andSampler
to provide an iterable over the givenRandomAccessDataset
.We don't recommended using DataIterable directly. Instead use
RandomAccessDataset
combined withTrainer
to 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 ofDataIterable
with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
java.util.Iterator<Batch>
iterator()
Batch
next()
-
-
-
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 ofDataIterable
with 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
- anExecutorService
preFetchNumber
- the number of samples to prefetchdevice
- theDevice
-
-