public class SimpleTextDecoder
extends ai.djl.modality.nlp.Decoder
SimpleTextDecoder implements a Decoder that employs a RecurrentBlock to
decode text input.| Constructor and Description |
|---|
SimpleTextDecoder(ai.djl.nn.recurrent.RecurrentBlock recurrentBlock,
int vocabSize)
Contructs a new instance of
SimpleTextDecoder with the given RecurrentBlock. |
SimpleTextDecoder(ai.djl.modality.nlp.embedding.TrainableTextEmbedding trainableTextEmbedding,
ai.djl.nn.recurrent.RecurrentBlock recurrentBlock,
long vocabSize)
Contructs a new instance of
SimpleTextDecoder with the given RecurrentBlock. |
| Modifier and Type | Method and Description |
|---|---|
protected ai.djl.ndarray.NDList |
forwardInternal(ai.djl.training.ParameterStore parameterStore,
ai.djl.ndarray.NDList inputs,
boolean training,
ai.djl.util.PairList<java.lang.String,java.lang.Object> params) |
getOutputShapes, initializeChildBlocks, loadParameters, saveParametersaddChildBlock, addParameter, beforeInitialize, cast, clear, describeInput, forward, forward, forwardInternal, getChildren, getDirectParameters, getParameters, initialize, isInitialized, loadMetadata, prepare, readInputShapes, saveInputShapes, saveMetadata, setInitializer, setInitializer, setInitializer, toStringpublic SimpleTextDecoder(ai.djl.nn.recurrent.RecurrentBlock recurrentBlock,
int vocabSize)
SimpleTextDecoder with the given RecurrentBlock.
Use this constructor if you are planning to use pre-trained embeddings that don't need
further training.recurrentBlock - the recurrent block to be used to decodevocabSize - the size of the Vocabularypublic SimpleTextDecoder(ai.djl.modality.nlp.embedding.TrainableTextEmbedding trainableTextEmbedding,
ai.djl.nn.recurrent.RecurrentBlock recurrentBlock,
long vocabSize)
SimpleTextDecoder with the given RecurrentBlock.
Use this constructor if you are planning to use pre-trained embeddings that don't need
further training.trainableTextEmbedding - the TrainableTextEmbedding to train embeddings withrecurrentBlock - the recurrent block to be used to decodevocabSize - the size of the Vocabularyprotected ai.djl.ndarray.NDList forwardInternal(ai.djl.training.ParameterStore parameterStore,
ai.djl.ndarray.NDList inputs,
boolean training,
ai.djl.util.PairList<java.lang.String,java.lang.Object> params)
forwardInternal in class ai.djl.modality.nlp.Decoder