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 class
CnnSentenceDataSetIterator.Builder
static class
CnnSentenceDataSetIterator.Format
Format 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 class
CnnSentenceDataSetIterator.UnknownWordHandling
-
Constructor Summary
Constructors Modifier Constructor Description protected
CnnSentenceDataSetIterator(CnnSentenceDataSetIterator.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
asyncSupported()
int
batch()
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 predictionsorg.nd4j.linalg.dataset.DataSet
next()
org.nd4j.linalg.dataset.DataSet
next(int num)
void
remove()
void
reset()
boolean
resetSupported()
void
setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
int
totalOutcomes()
-
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:
getLabels
in 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:
next
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
inputColumns
public int inputColumns()
- Specified by:
inputColumns
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
totalOutcomes
public int totalOutcomes()
- Specified by:
totalOutcomes
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
resetSupported
public boolean resetSupported()
- Specified by:
resetSupported
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
asyncSupported
public boolean asyncSupported()
- Specified by:
asyncSupported
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
reset
public void reset()
- Specified by:
reset
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
batch
public int batch()
- Specified by:
batch
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
setPreProcessor
public void setPreProcessor(org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor)
- Specified by:
setPreProcessor
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
getPreProcessor
public org.nd4j.linalg.dataset.api.DataSetPreProcessor getPreProcessor()
- Specified by:
getPreProcessor
in interfaceorg.nd4j.linalg.dataset.api.iterator.DataSetIterator
-
-