Class AbstractDataSetIterator<T>
- java.lang.Object
-
- org.deeplearning4j.datasets.iterator.AbstractDataSetIterator<T>
-
- All Implemented Interfaces:
Serializable,Iterator<DataSet>,DataSetIterator
- Direct Known Subclasses:
DoublesDataSetIterator,FloatsDataSetIterator,INDArrayDataSetIterator
public abstract class AbstractDataSetIterator<T> extends Object implements DataSetIterator
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDataSetIterator(@NonNull Iterable<org.nd4j.common.primitives.Pair<T,T>> iterable, int batchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasyncSupported()intbatch()Batch sizeprotected voidfillQueue()List<String>getLabels()Get dataset iterator record reader labelsDataSetPreProcessorgetPreProcessor()booleanhasNext()Returnstrueif the iteration has more elements.intinputColumns()Input columns for the datasetDataSetnext()Returns the next element in the iteration.DataSetnext(int num)Like the standard next method but allows a customizable number of examples returnedvoidremove()Removes from the underlying collection the last element returned by this iterator (optional operation).voidreset()Resets the iterator back to the beginningbooleanresetSupported()voidsetPreProcessor(DataSetPreProcessor preProcessor)Set a pre processorinttotalOutcomes()The number of labels for the dataset-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
next
public DataSet next(int num)
Like the standard next method but allows a customizable number of examples returned- Specified by:
nextin interfaceDataSetIterator- Parameters:
num- the number of examples- Returns:
- the next data applyTransformToDestination
-
inputColumns
public int inputColumns()
Input columns for the dataset- Specified by:
inputColumnsin interfaceDataSetIterator- Returns:
-
totalOutcomes
public int totalOutcomes()
The number of labels for the dataset- Specified by:
totalOutcomesin interfaceDataSetIterator- Returns:
-
resetSupported
public boolean resetSupported()
- Specified by:
resetSupportedin interfaceDataSetIterator
-
asyncSupported
public boolean asyncSupported()
- Specified by:
asyncSupportedin interfaceDataSetIterator
-
reset
public void reset()
Resets the iterator back to the beginning- Specified by:
resetin interfaceDataSetIterator
-
batch
public int batch()
Batch size- Specified by:
batchin interfaceDataSetIterator- Returns:
-
setPreProcessor
public void setPreProcessor(DataSetPreProcessor preProcessor)
Set a pre processor- Specified by:
setPreProcessorin interfaceDataSetIterator- Parameters:
preProcessor- a pre processor to set
-
getLabels
public List<String> getLabels()
Get dataset iterator record reader labels- Specified by:
getLabelsin interfaceDataSetIterator
-
hasNext
public boolean hasNext()
Returnstrueif the iteration has more elements. (In other words, returnstrueifnext(int)would return an element rather than throwing an exception.)
-
fillQueue
protected void fillQueue()
-
next
public DataSet next() throws NoSuchElementException
Returns the next element in the iteration.- Specified by:
nextin interfaceIterator<T>- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException- if the iteration has no more elements
-
remove
public void remove()
Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call tonext(int). The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.- Specified by:
removein interfaceIterator<T>- Throws:
UnsupportedOperationException- if theremoveoperation is not supported by this iteratorIllegalStateException- if thenextmethod has not yet been called, or theremovemethod has already been called after the last call to thenextmethod
-
getPreProcessor
public DataSetPreProcessor getPreProcessor()
- Specified by:
getPreProcessorin interfaceDataSetIterator
-
-