Class EDHead
java.lang.Object
me.damoebe.architectures.transformer.mha.Head
me.damoebe.architectures.transformer.mha.EDHead
-
Field Summary
Fields inherited from class me.damoebe.architectures.transformer.mha.Head
biases, inputEmbeddingAmount, inputEmbeddingSize, learningRate, masked, weights -
Constructor Summary
ConstructorsConstructorDescriptionEDHead(int inputEmbeddingAmount, int inputEmbeddingSize, double learningRae) The main constructor of the decoder Head Identical to the super constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected List<double[][]> generateQKVMatrices(Sequence[] inputEmbeddings) Calculates the QKVMatrices based on the decoder and encoder input embeddings.Methods inherited from class me.damoebe.architectures.transformer.mha.Head
backPropagate, getInputEmbeddingAmount, getInputEmbeddingSize, getOutput, insertInput
-
Constructor Details
-
EDHead
public EDHead(int inputEmbeddingAmount, int inputEmbeddingSize, double learningRae) The main constructor of the decoder Head Identical to the super constructor- Parameters:
inputEmbeddingAmount- The amount of input embeddingsinputEmbeddingSize- The size of each input embedding
-
-
Method Details
-
generateQKVMatrices
Calculates the QKVMatrices based on the decoder and encoder input embeddings.- Overrides:
generateQKVMatricesin classHead- Parameters:
inputEmbeddings- The input Embedding lists -> here it has to contain 2 embedding lists. [0] is the decoder input and [1] is the encoder input- Returns:
- The query, key and value matrices which will be used to calculate the attention.
- Throws:
Exception
-