public class DataIterable extends java.lang.Object implements java.lang.Iterable<Batch>, java.util.Iterator<Batch>
Dataset
, Batchifier
, Pipeline
, and Sampler
to provide an iterable over the given RandomAccessDataset
.
We don't recommended using DataIterable directly. Instead use RandomAccessDataset
combined with Trainer
to iterate over the RandomAccessDataset
}
Constructor and 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 of
DataIterable with the given parameters. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
java.util.Iterator<Batch> |
iterator() |
Batch |
next() |
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)
DataIterable
with the given 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
- an ExecutorService
preFetchNumber
- the number of samples to prefetchdevice
- the Device