public class SimpleTextEncoder
extends ai.djl.modality.nlp.Encoder
SimpleTextEncoder implements a Encoder that employs a RecurrentBlock to
encode text input.| Constructor and Description |
|---|
SimpleTextEncoder(ai.djl.nn.recurrent.RecurrentBlock recurrentBlock)
Contructs a new instance of
SimpleTextEncoder with the given RecurrentBlock. |
SimpleTextEncoder(ai.djl.modality.nlp.embedding.TrainableTextEmbedding trainableTextEmbedding,
ai.djl.nn.recurrent.RecurrentBlock recurrentBlock)
Contructs a new instance of
SimpleTextEncoder with the given RecurrentBlock
and TrainableTextEmbedding. |
| Modifier and Type | Method and Description |
|---|---|
ai.djl.ndarray.NDList |
getStates(ai.djl.ndarray.NDList encoderOutput) |
forwardInternal, forwardInternal, getOutputShapes, initializeChildBlocks, loadParameters, saveParametersaddChildBlock, addParameter, beforeInitialize, cast, clear, describeInput, forward, forward, getChildren, getDirectParameters, getParameters, initialize, isInitialized, loadMetadata, prepare, readInputShapes, saveInputShapes, saveMetadata, setInitializer, setInitializer, setInitializer, toStringpublic SimpleTextEncoder(ai.djl.nn.recurrent.RecurrentBlock recurrentBlock)
SimpleTextEncoder 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 encodepublic SimpleTextEncoder(ai.djl.modality.nlp.embedding.TrainableTextEmbedding trainableTextEmbedding,
ai.djl.nn.recurrent.RecurrentBlock recurrentBlock)
SimpleTextEncoder with the given RecurrentBlock
and TrainableTextEmbedding. Use this constructor if you are planning to use
pre-trained or fresh embeddings that need further training.trainableTextEmbedding - the TrainableTextEmbedding to train embeddings withrecurrentBlock - the recurrent block to be used to encode