Class DataIterable

java.lang.Object
ai.djl.training.dataset.DataIterable
All Implemented Interfaces:
Iterable<Batch>, Iterator<Batch>
Direct Known Subclasses:
BulkDataIterable

public class DataIterable extends Object implements Iterable<Batch>, Iterator<Batch>
DataIterable is a data loader that combines 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}

  • Field Details

  • Constructor Details

    • DataIterable

      public DataIterable(RandomAccessDataset dataset, NDManager manager, Sampler sampler, Batchifier dataBatchifier, Batchifier labelBatchifier, Pipeline pipeline, Pipeline targetPipeline, ExecutorService executor, int preFetchNumber, Device device)
      Creates a new instance of DataIterable with the given parameters.
      Parameters:
      dataset - the dataset to iterate on
      manager - the manager to create the arrays
      sampler - a sampler to sample data with
      dataBatchifier - a batchifier for data
      labelBatchifier - a batchifier for labels
      pipeline - the pipeline of transforms to apply on the data
      targetPipeline - the pipeline of transforms to apply on the labels
      executor - an ExecutorService
      preFetchNumber - the number of samples to prefetch
      device - the Device
  • Method Details