Package org.deeplearning4j.iterator
Class CnnSentenceDataSetIterator
- java.lang.Object
-
- org.deeplearning4j.iterator.CnnSentenceDataSetIterator
-
- All Implemented Interfaces:
Serializable,Iterator<org.nd4j.linalg.dataset.DataSet>,org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public class CnnSentenceDataSetIterator extends Object implements org.nd4j.linalg.dataset.api.iterator.DataSetIterator
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCnnSentenceDataSetIterator.Builderstatic classCnnSentenceDataSetIterator.FormatFormat of features:
CNN1D: For use with 1d convolution layers: Shape [minibatch, vectorSize, sentenceLength]
CNN2D: For use with 2d convolution layers: Shape [minibatch, 1, vectorSize, sentenceLength] or [minibatch, 1, sentenceLength, vectorSize], depending on the setting for 'sentencesAlongHeight' configuration.static classCnnSentenceDataSetIterator.UnknownWordHandling
-
Constructor Summary
Constructors Modifier Constructor Description protectedCnnSentenceDataSetIterator(CnnSentenceDataSetIterator.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasyncSupported()intbatch()Map<String,Integer>getLabelClassMap()List<String>getLabels()org.nd4j.linalg.dataset.api.DataSetPreProcessorgetPreProcessor()booleanhasNext()intinputColumns()org.nd4j.linalg.api.ndarray.INDArrayloadSingleSentence(String sentence)Generally used post training time to load a single sentence for predictionsorg.nd4j.linalg.dataset.DataSetnext()org.nd4j.linalg.dataset.DataSetnext(int num)voidremove()voidreset()booleanresetSupported()voidsetPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)inttotalOutcomes()-
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
-
CnnSentenceDataSetIterator
protected CnnSentenceDataSetIterator(CnnSentenceDataSetIterator.Builder builder)
-
-
Method Detail
-
loadSingleSentence
public org.nd4j.linalg.api.ndarray.INDArray loadSingleSentence(String sentence)
Generally used post training time to load a single sentence for predictions
-
getLabels
public List<String> getLabels()
- Specified by:
getLabelsin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
hasNext
public boolean hasNext()
-
next
public org.nd4j.linalg.dataset.DataSet next()
-
next
public org.nd4j.linalg.dataset.DataSet next(int num)
- Specified by:
nextin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
inputColumns
public int inputColumns()
- Specified by:
inputColumnsin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
totalOutcomes
public int totalOutcomes()
- Specified by:
totalOutcomesin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
resetSupported
public boolean resetSupported()
- Specified by:
resetSupportedin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
asyncSupported
public boolean asyncSupported()
- Specified by:
asyncSupportedin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
reset
public void reset()
- Specified by:
resetin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
batch
public int batch()
- Specified by:
batchin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
setPreProcessor
public void setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
- Specified by:
setPreProcessorin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
getPreProcessor
public org.nd4j.linalg.dataset.api.DataSetPreProcessor getPreProcessor()
- Specified by:
getPreProcessorin interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
-