Package ai.djl.nn.transformer
package ai.djl.nn.transformer
Contains blocks for transformer models.
-
ClassesClassDescriptionImplements the core bert model (without next sentence and masked language task) of bert.Block for the bert masked language task.The loss for the bert masked language model task.Block to perform the Bert next-sentence-prediction task.Calculates the loss for the next sentence prediction task.Creates a block that performs all bert pretraining tasks (next sentence and masked language).Loss that combines the next sentence and masked language losses of bert pretraining.An Embedding from integer ids to float vectors.The Builder to construct an
IdEmbedding
type ofBlock
.Fully connected Feed-Forward network, only applied to the last dimension of the input.A Block implementing scaled product attention according to Vaswani et.A builder forScaledDotProductAttentionBlock
s.Self-Attention based transformer encoder block.