Data Iterators
DataSetIterator implementations — built-in iterators, custom iterators, async loading, and data splitting
The DataSetIterator Interface
public interface DataSetIterator extends Iterator<DataSet>, Iterable<DataSet> {
// Returns the next minibatch (use batch() to retrieve the configured batch size)
DataSet next();
// Returns the next minibatch with a specific size
DataSet next(int num);
// Number of input features per example
int inputColumns();
// Number of output labels per example
int totalOutcomes();
// Whether reset() is supported
boolean resetSupported();
// Whether async prefetching is safe to use with this iterator
boolean asyncSupported();
// Reset to the beginning of the dataset
void reset();
// Configured minibatch size
int batch();
// Optional preprocessor applied to each DataSet before it is returned
void setPreProcessor(DataSetPreProcessor preProcessor);
DataSetPreProcessor getPreProcessor();
// List of label names (may return null)
List<String> getLabels();
boolean hasNext();
}Built-in Dataset Iterators
MnistDataSetIterator
Cifar10DataSetIterator
IrisDataSetIterator
EmnistDataSetIterator
Subset constant
Classes
Training examples
UciSequenceDataSetIterator
LFWDataSetIterator
TinyImageNetDataSetIterator
RecordReaderDataSetIterator
Classification from CSV
Regression from CSV
Image Classification
Builder Reference
Method
Description
Loading by Metadata
SequenceRecordReaderDataSetIterator
Mode
Description
RecordReaderMultiDataSetIterator
Async Data Loading
AsyncDataSetIterator
AsyncMultiDataSetIterator
AsyncShieldDataSetIterator
Utility Iterators
WorkspacesShieldDataSetIterator
INDArrayDataSetIterator
DoublesDataSetIterator
SamplingDataSetIterator
Train/Test Splitting
DataSetIteratorSplitter
MultiDataSetIteratorSplitter
Creating Custom Iterators
Minimal Implementation
Using a PreProcessor
Interface Reference
Class / Interface
Package
Last updated
Was this helpful?