public abstract class AbstractDataSetIterator<T>
extends java.lang.Object
implements org.nd4j.linalg.dataset.api.iterator.DataSetIterator
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDataSetIterator(java.lang.Iterable<Pair<T,T>> iterable,
int batchSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asyncSupported() |
int |
batch()
Batch size
|
int |
cursor()
The current cursor if applicable
|
protected void |
fillQueue() |
java.util.List<java.lang.String> |
getLabels()
Get dataset iterator record reader labels
|
org.nd4j.linalg.dataset.api.DataSetPreProcessor |
getPreProcessor() |
boolean |
hasNext()
Returns
true if the iteration has more elements. |
int |
inputColumns()
Input columns for the dataset
|
org.nd4j.linalg.dataset.DataSet |
next()
Returns the next element in the iteration.
|
org.nd4j.linalg.dataset.DataSet |
next(int num)
Like the standard next method but allows a
customizable number of examples returned
|
int |
numExamples()
Total number of examples in the dataset
|
void |
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
void |
reset()
Resets the iterator back to the beginning
|
boolean |
resetSupported() |
void |
setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
Set a pre processor
|
int |
totalExamples()
Total examples in the iterator
|
int |
totalOutcomes()
The number of labels for the dataset
|
public org.nd4j.linalg.dataset.DataSet next(int num)
next in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratornum - the number of examplespublic int totalExamples()
totalExamples in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic int inputColumns()
inputColumns in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic int totalOutcomes()
totalOutcomes in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic boolean resetSupported()
resetSupported in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic boolean asyncSupported()
asyncSupported in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic void reset()
reset in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic int batch()
batch in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic int cursor()
cursor in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic int numExamples()
numExamples in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic void setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
setPreProcessor in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpreProcessor - a pre processor to setpublic java.util.List<java.lang.String> getLabels()
getLabels in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic boolean hasNext()
true if the iteration has more elements.
(In other words, returns true if next(int) would
return an element rather than throwing an exception.)hasNext in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>true if the iteration has more elementsprotected void fillQueue()
public org.nd4j.linalg.dataset.DataSet next()
throws java.util.NoSuchElementException
next in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>java.util.NoSuchElementException - if the iteration has no more elementspublic void remove()
next(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.remove in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>java.lang.UnsupportedOperationException - if the remove
operation is not supported by this iteratorjava.lang.IllegalStateException - if the next method has not
yet been called, or the remove method has already
been called after the last call to the next
methodpublic org.nd4j.linalg.dataset.api.DataSetPreProcessor getPreProcessor()
getPreProcessor in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator