Core Types in go-attention
mainThe library uses three primary types for numerical data:
Vector: A 1D slice offloat64values used for embeddings and attention weights.Matrix: A 2D slice ofVector(i.e.,[]Vector) used for batched operations and multi-dimensional data.AttentionWeights: A type alias forVector, used to provide semantic clarity in attention-related function signatures.
type Vector []float64
type Matrix []Vector
type AttentionWeights = Vector