Class Sequence
java.lang.Object
me.damoebe.architectures.transformer.embedding.Sequence
A container class for a transformer internal Embedding-Sequence
-
Constructor Summary
ConstructorsConstructorDescriptionSequence()Creates a new empty Embedding-Sequence.Constructs a Sequence from a raw-input-data list by tokenizing it and positional-encode each token.Constructs a Sequence from an embedding list (used for sub-sequence splitting) -
Method Summary
Modifier and TypeMethodDescriptionGetter for the stored embeddingsdouble[][]Gets the horizontal matrix of this sequence (rows -> embeddingData, columns -> embedding)Generate a 'raw' Double list for this sequence containing all embedding valuesgetSubSequences(int subSequenceAmount) Splits this sequences into n sub-sequencesdouble[][]Gets the vertical (standard dimensions) matrix of this sequence where rows -> embeddings and columns -> embeddingData
-
Constructor Details
-
Sequence
public Sequence()Creates a new empty Embedding-Sequence. -
Sequence
Constructs a Sequence from a raw-input-data list by tokenizing it and positional-encode each token.- Parameters:
rawSequenceData- The input sequence (un-tokenized) as a Double List.tokenSize- The data-size each token (embedding) should have.
-
Sequence
-
-
Method Details
-
getRawList
-
getHorizontalMatrix
public double[][] getHorizontalMatrix()Gets the horizontal matrix of this sequence (rows -> embeddingData, columns -> embedding)- Returns:
- The horizontal Matrix
-
getVerticalMatrix
public double[][] getVerticalMatrix()Gets the vertical (standard dimensions) matrix of this sequence where rows -> embeddings and columns -> embeddingData- Returns:
- The vertical Matrix
-
getSubSequences
-
embeddings
-