Class RoPEMultiHeadSelfAttention
java.lang.Object
io.github.kirstenali.deepj.layers.transformer.attention.MultiHeadSelfAttention
io.github.kirstenali.deepj.layers.transformer.attention.RoPEMultiHeadSelfAttention
-
Field Summary
Fields inherited from class io.github.kirstenali.deepj.layers.transformer.attention.MultiHeadSelfAttention
headDim, nHeads -
Constructor Summary
ConstructorsConstructorDescriptionRoPEMultiHeadSelfAttention(int dModel, int nHeads, boolean causalMask, RotaryEmbedding rope, Random rnd) RoPEMultiHeadSelfAttention(int dModel, int nHeads, boolean causalMask, RotaryEmbedding rope, Random rnd, ParameterFactory parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected TensortransformQueryKey(Tensor heads, int seqLen) protected TensortransformQueryKey(Tensor heads, int length, int offset) protected TensortransformQueryKey(Tensor heads, int length, InferenceContext context) Methods inherited from class io.github.kirstenali.deepj.layers.transformer.attention.MultiHeadSelfAttention
forward, forward, parameters, supportsIncrementalInference
-
Constructor Details
-
RoPEMultiHeadSelfAttention
public RoPEMultiHeadSelfAttention(int dModel, int nHeads, boolean causalMask, RotaryEmbedding rope, Random rnd) -
RoPEMultiHeadSelfAttention
public RoPEMultiHeadSelfAttention(int dModel, int nHeads, boolean causalMask, RotaryEmbedding rope, Random rnd, ParameterFactory parameters)
-
-
Method Details
-
transformQueryKey
- Overrides:
transformQueryKeyin classMultiHeadSelfAttention
-
transformQueryKey
- Overrides:
transformQueryKeyin classMultiHeadSelfAttention
-
transformQueryKey
- Overrides:
transformQueryKeyin classMultiHeadSelfAttention
-