public class SequenceRecordReaderDataSetIterator
extends java.lang.Object
implements org.nd4j.linalg.dataset.api.iterator.DataSetIterator
SequenceRecordReaderDataSetIterator.AlignmentMode
mode.Modifier and Type | Class and Description |
---|---|
static class |
SequenceRecordReaderDataSetIterator.AlignmentMode
Alignment mode for dealing with input/labels of differing lengths (for example, one-to-many and many-to-one type situations).
|
Constructor and Description |
---|
SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader reader,
int miniBatchSize,
int numPossibleLabels,
int labelIndex)
Constructor where features and labels come from the SAME RecordReader (i.e., target/label is a column in the
same data as the features).
|
SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader reader,
int miniBatchSize,
int numPossibleLabels,
int labelIndex,
boolean regression)
Constructor where features and labels come from the SAME RecordReader (i.e., target/label is a column in the
same data as the features)
|
SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader featuresReader,
org.datavec.api.records.reader.SequenceRecordReader labels,
int miniBatchSize,
int numPossibleLabels)
Constructor where features and labels come from different RecordReaders (for example, different files),
and labels are for classification.
|
SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader featuresReader,
org.datavec.api.records.reader.SequenceRecordReader labels,
int miniBatchSize,
int numPossibleLabels,
boolean regression)
Constructor where features and labels come from different RecordReaders (for example, different files)
|
SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader featuresReader,
org.datavec.api.records.reader.SequenceRecordReader labels,
int miniBatchSize,
int numPossibleLabels,
boolean regression,
SequenceRecordReaderDataSetIterator.AlignmentMode alignmentMode)
Constructor where features and labels come from different RecordReaders (for example, different files)
|
Modifier and Type | Method and Description |
---|---|
boolean |
asyncSupported() |
int |
batch() |
int |
cursor() |
java.util.List<java.lang.String> |
getLabels() |
boolean |
hasNext() |
int |
inputColumns() |
org.nd4j.linalg.dataset.DataSet |
loadFromMetaData(java.util.List<org.datavec.api.records.metadata.RecordMetaData> list)
Load a multiple sequence examples to a DataSet, using the provided RecordMetaData instances.
|
org.nd4j.linalg.dataset.DataSet |
loadFromMetaData(org.datavec.api.records.metadata.RecordMetaData recordMetaData)
Load a single sequence example to a DataSet, using the provided RecordMetaData.
|
org.nd4j.linalg.dataset.DataSet |
next() |
org.nd4j.linalg.dataset.DataSet |
next(int num) |
int |
numExamples() |
void |
remove() |
void |
reset() |
boolean |
resetSupported() |
void |
setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor) |
int |
totalExamples() |
int |
totalOutcomes() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader featuresReader, org.datavec.api.records.reader.SequenceRecordReader labels, int miniBatchSize, int numPossibleLabels)
featuresReader
- SequenceRecordReader for the featureslabels
- Labels: assume single value per time step, where values are integers in the range 0 to numPossibleLables-1miniBatchSize
- Minibatch size for each call of next()numPossibleLabels
- Number of classes for the labelspublic SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader featuresReader, org.datavec.api.records.reader.SequenceRecordReader labels, int miniBatchSize, int numPossibleLabels, boolean regression)
public SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader featuresReader, org.datavec.api.records.reader.SequenceRecordReader labels, int miniBatchSize, int numPossibleLabels, boolean regression, SequenceRecordReaderDataSetIterator.AlignmentMode alignmentMode)
public SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader reader, int miniBatchSize, int numPossibleLabels, int labelIndex)
reader
- SequenceRecordReader with dataminiBatchSize
- size of each minibatchnumPossibleLabels
- number of labels/classes for classification (or not used if regression == true)labelIndex
- index in input of the label indexpublic SequenceRecordReaderDataSetIterator(org.datavec.api.records.reader.SequenceRecordReader reader, int miniBatchSize, int numPossibleLabels, int labelIndex, boolean regression)
reader
- SequenceRecordReader with dataminiBatchSize
- size of each minibatchnumPossibleLabels
- number of labels/classes for classification (or not used if regression == true)labelIndex
- index in input of the label indexregression
- Whether output is for regression or classificationpublic 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.DataSetIterator
public int totalExamples()
totalExamples
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public int inputColumns()
inputColumns
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public int totalOutcomes()
totalOutcomes
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public boolean resetSupported()
resetSupported
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public boolean asyncSupported()
asyncSupported
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public void reset()
reset
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public int batch()
batch
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public int cursor()
cursor
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public int numExamples()
numExamples
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public void setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
setPreProcessor
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public java.util.List<java.lang.String> getLabels()
getLabels
in interface org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public void remove()
remove
in interface java.util.Iterator<org.nd4j.linalg.dataset.DataSet>
public org.nd4j.linalg.dataset.DataSet loadFromMetaData(org.datavec.api.records.metadata.RecordMetaData recordMetaData) throws java.io.IOException
loadFromMetaData(List)
recordMetaData
- RecordMetaData to load from. Should have been produced by the given record readerjava.io.IOException
- If an error occurs during loading of the datapublic org.nd4j.linalg.dataset.DataSet loadFromMetaData(java.util.List<org.datavec.api.records.metadata.RecordMetaData> list) throws java.io.IOException
list
- List of RecordMetaData instances to load from. Should have been produced by the record reader provided
to the SequenceRecordReaderDataSetIterator constructorjava.io.IOException
- If an error occurs during loading of the data