public class DefaultDataSetIterator
extends java.lang.Object
implements org.nd4j.linalg.dataset.api.iterator.DataSetIterator, java.io.Serializable
| Constructor and Description |
|---|
DefaultDataSetIterator(org.nd4j.linalg.dataset.DataSet data,
int batchSize)
Constructs a new dataset iterator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
asyncSupported()
Whether the iterator can be used asynchronously.
|
int |
batch()
The size of the mini batches.
|
java.util.List<java.lang.String> |
getLabels()
Gets the labels.
|
org.nd4j.linalg.dataset.api.DataSetPreProcessor |
getPreProcessor()
Gets the preprocessor.
|
boolean |
hasNext()
Whether another batch of data is still available.
|
int |
inputColumns()
Returns the number of input columns.
|
org.nd4j.linalg.dataset.DataSet |
next()
Returns the next mini batch of data.
|
org.nd4j.linalg.dataset.DataSet |
next(int num)
Returns a batch of the given size
|
void |
remove()
Enables removing of a mini-batch.
|
void |
reset()
Resets the cursor.
|
boolean |
resetSupported()
Whether the iterator can be reset.
|
void |
setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
Sets the preprocessor.
|
int |
totalOutcomes()
Returns the total number of labels.
|
public DefaultDataSetIterator(org.nd4j.linalg.dataset.DataSet data,
int batchSize)
data - The dataset to operate onbatchSize - The batch sizepublic boolean hasNext()
hasNext in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>public org.nd4j.linalg.dataset.DataSet next()
next in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>public org.nd4j.linalg.dataset.DataSet next(int num)
next in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratornum - the size of the batch to returnpublic int inputColumns()
inputColumns in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic int totalOutcomes()
totalOutcomes in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic void reset()
reset 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 int batch()
batch in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic org.nd4j.linalg.dataset.api.DataSetPreProcessor getPreProcessor()
getPreProcessor 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 DataSet preprocessor.public java.util.List<java.lang.String> getLabels()
getLabels in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic void remove()
remove in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>