public class CnnSentenceDataSetIterator extends Object implements org.nd4j.linalg.dataset.api.iterator.DataSetIterator
Specifically:
- Features have shape [minibatchSize, 1, maxSentenceLength, wordVectorSize] OR [minibatchSize, 1, wordVectorSize, maxSentenceLength]
depending on the configuration (for sentencesAlongHeight = true/false respectively)
- Labels are a 2d array with shape [minibatchSize, numLabels].
Sentences and labels are provided by a LabeledSentenceProvider - different implementations of this provide different
ways of loading sentences/documents with labels - for example, from files, etc.
Note: With regard to labels to class index assignment, they are sorted alphabetically. To get the assigment/mapping,
use getLabels() or getLabelClassMap()
| Modifier and Type | Class and Description |
|---|---|
static class |
CnnSentenceDataSetIterator.Builder |
static class |
CnnSentenceDataSetIterator.UnknownWordHandling |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asyncSupported() |
int |
batch() |
int |
cursor() |
Map<String,Integer> |
getLabelClassMap() |
List<String> |
getLabels() |
org.nd4j.linalg.dataset.api.DataSetPreProcessor |
getPreProcessor() |
boolean |
hasNext() |
int |
inputColumns() |
org.nd4j.linalg.api.ndarray.INDArray |
loadSingleSentence(String sentence)
Generally used post training time to load a single sentence for predictions
|
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, waitforEachRemainingpublic org.nd4j.linalg.api.ndarray.INDArray loadSingleSentence(String sentence)
public List<String> getLabels()
getLabels in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic boolean hasNext()
public org.nd4j.linalg.dataset.DataSet next()
public org.nd4j.linalg.dataset.DataSet next(int num)
next in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorpublic 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.DataSetIteratorpublic org.nd4j.linalg.dataset.api.DataSetPreProcessor getPreProcessor()
getPreProcessor in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorCopyright © 2018. All rights reserved.