Package org.nd4j.linalg.dataset.adapter
Class MultiDataSetIteratorAdapter
- java.lang.Object
-
- org.nd4j.linalg.dataset.adapter.MultiDataSetIteratorAdapter
-
- All Implemented Interfaces:
Serializable
,Iterator<MultiDataSet>
,MultiDataSetIterator
public class MultiDataSetIteratorAdapter extends Object implements MultiDataSetIterator
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiDataSetIteratorAdapter(DataSetIterator iter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
asyncSupported()
Does this MultiDataSetIterator support asynchronous prefetching of multiple MultiDataSet objects? Most MultiDataSetIterators do, but in some cases it may not make sense to wrap this iterator in an iterator that does asynchronous prefetching.MultiDataSetPreProcessor
getPreProcessor()
Get theMultiDataSetPreProcessor
, if one has previously been set.boolean
hasNext()
MultiDataSet
next()
MultiDataSet
next(int i)
Fetch the next 'num' examples.void
remove()
void
reset()
Resets the iterator back to the beginningboolean
resetSupported()
Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting, but some don'tvoid
setPreProcessor(MultiDataSetPreProcessor multiDataSetPreProcessor)
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
-
MultiDataSetIteratorAdapter
public MultiDataSetIteratorAdapter(DataSetIterator iter)
-
-
Method Detail
-
next
public MultiDataSet next(int i)
Description copied from interface:MultiDataSetIterator
Fetch the next 'num' examples. Similar to the next method, but returns a specified number of examples- Specified by:
next
in interfaceMultiDataSetIterator
- Parameters:
i
- Number of examples to fetch
-
setPreProcessor
public void setPreProcessor(MultiDataSetPreProcessor multiDataSetPreProcessor)
Description copied from interface:MultiDataSetIterator
Set the preprocessor to be applied to each MultiDataSet, before each MultiDataSet is returned.- Specified by:
setPreProcessor
in interfaceMultiDataSetIterator
- Parameters:
multiDataSetPreProcessor
- MultiDataSetPreProcessor. May be null.
-
getPreProcessor
public MultiDataSetPreProcessor getPreProcessor()
Description copied from interface:MultiDataSetIterator
Get theMultiDataSetPreProcessor
, if one has previously been set. Returns null if no preprocessor has been set- Specified by:
getPreProcessor
in interfaceMultiDataSetIterator
- Returns:
- Preprocessor
-
resetSupported
public boolean resetSupported()
Description copied from interface:MultiDataSetIterator
Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting, but some don't- Specified by:
resetSupported
in interfaceMultiDataSetIterator
- Returns:
- true if reset method is supported; false otherwise
-
asyncSupported
public boolean asyncSupported()
Description copied from interface:MultiDataSetIterator
Does this MultiDataSetIterator support asynchronous prefetching of multiple MultiDataSet objects? Most MultiDataSetIterators do, but in some cases it may not make sense to wrap this iterator in an iterator that does asynchronous prefetching. For example, it would not make sense to use asynchronous prefetching for the following types of iterators: (a) Iterators that store their full contents in memory already (b) Iterators that re-use features/labels arrays (as future next() calls will overwrite past contents) (c) Iterators that already implement some level of asynchronous prefetching (d) Iterators that may return different data depending on when the next() method is called- Specified by:
asyncSupported
in 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()
Description copied from interface:MultiDataSetIterator
Resets the iterator back to the beginning- Specified by:
reset
in interfaceMultiDataSetIterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<MultiDataSet>
-
next
public MultiDataSet next()
- Specified by:
next
in interfaceIterator<MultiDataSet>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<MultiDataSet>
-
-