lamp.nn.languagemodel.LanguageModelInput
See theLanguageModelInput companion object
Input to language model
Value parameters
- maxLength
-
batch x sequence OR batch, see maskedSoftmax. Used to define masking of the attention matrix. Use cases:
- Left-to-right (causal) attention with uniform sequence length. In this case use a batch x sequence 2D matrix with arange(0,sequence) in each row.
- Variable length sequences with bidirectional attention. In this case use a 1D [batch] vector with the real length of each sequence (rest are padded).
- If empty the attention matrix is not masked
- positions
-
batch x sequence, type long in [0,sequence], selects positions. Final LM logits are computed on the selected positions. If empty then selects all positions.
- tokens
-
batch x sequence, type long
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article