Class AsyncShieldMultiDataSetIterator
- java.lang.Object
-
- org.deeplearning4j.datasets.iterator.AsyncShieldMultiDataSetIterator
-
- All Implemented Interfaces:
Serializable,Iterator<MultiDataSet>,MultiDataSetIterator
public class AsyncShieldMultiDataSetIterator extends Object implements MultiDataSetIterator
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AsyncShieldMultiDataSetIterator(@NonNull MultiDataSetIterator iterator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasyncSupported()/** Does this DataSetIterator support asynchronous prefetching of multiple DataSet objects? PLEASE NOTE: This iterator ALWAYS returns FALSEMultiDataSetPreProcessorgetPreProcessor()booleanhasNext()Returnstrueif the iteration has more elements.MultiDataSetnext()Returns the next element in the iteration.MultiDataSetnext(int num)Fetch the next 'num' examples.voidremove()Removes from the underlying collection the last element returned by this iterator (optional operation).voidreset()Resets the iterator back to the beginningbooleanresetSupported()Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting, but some don'tvoidsetPreProcessor(MultiDataSetPreProcessor preProcessor)Set the preprocessor to be applied to each MultiDataSet, before each MultiDataSet is returned.-
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
-
-
-
-
Constructor Detail
-
AsyncShieldMultiDataSetIterator
public AsyncShieldMultiDataSetIterator(@NonNull @NonNull MultiDataSetIterator iterator)
-
-
Method Detail
-
next
public MultiDataSet next(int num)
Fetch the next 'num' examples. Similar to the next method, but returns a specified number of examples- Specified by:
nextin interfaceMultiDataSetIterator- Parameters:
num- Number of examples to fetch
-
setPreProcessor
public void setPreProcessor(MultiDataSetPreProcessor preProcessor)
Set the preprocessor to be applied to each MultiDataSet, before each MultiDataSet is returned.- Specified by:
setPreProcessorin interfaceMultiDataSetIterator- Parameters:
preProcessor- MultiDataSetPreProcessor. May be null.
-
getPreProcessor
public MultiDataSetPreProcessor getPreProcessor()
- Specified by:
getPreProcessorin interfaceMultiDataSetIterator
-
resetSupported
public boolean resetSupported()
Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting, but some don't- Specified by:
resetSupportedin interfaceMultiDataSetIterator- Returns:
- true if reset method is supported; false otherwise
-
asyncSupported
public boolean asyncSupported()
/** Does this DataSetIterator support asynchronous prefetching of multiple DataSet objects? PLEASE NOTE: This iterator ALWAYS returns FALSE- Specified by:
asyncSupportedin interfaceMultiDataSetIterator- Returns:
- true if asynchronous prefetching from this iterator is OK; false if asynchronous prefetching should not be used with this iterator
-
reset
public void reset()
Resets the iterator back to the beginning- Specified by:
resetin interfaceMultiDataSetIterator
-
hasNext
public boolean hasNext()
Returnstrueif the iteration has more elements. (In other words, returnstrueifnext(int)would return an element rather than throwing an exception.)- Specified by:
hasNextin interfaceIterator<MultiDataSet>- Returns:
trueif the iteration has more elements
-
next
public MultiDataSet next()
Returns the next element in the iteration.- Specified by:
nextin interfaceIterator<MultiDataSet>- Returns:
- the next element in the iteration
-
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<MultiDataSet>- 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
-
-