Module 1 — Linear Algebra Foundations
Linear algebra is the mathematical foundation of Transformer models. Every embedding, attention score, projection layer, and feed-forward network is built using vectors and matrices.
Topics
- Vectors
- Matrices
- Matrix Multiplication
- Matrix Transpose
- Identity Matrix
- Inverse Matrix
- Determinant
- Rank
- Trace
- Dot Product
- Matrix Norms
- Vector Norms
- Cosine Similarity
- Eigenvalues
- Eigenvectors
- Singular Value Decomposition (SVD)
1. Vector
A vector is an ordered collection of numbers.
Formula
2. Matrix
A matrix is a rectangular array of numbers.
Formula
3. Matrix Multiplication
The product of two matrices.
Formula
::contentReference[oaicite:0]{index=0}
4. Matrix Transpose
Rows become columns.
Formula
5. Identity Matrix
The identity matrix leaves a matrix unchanged after multiplication.
Formula
6. Inverse Matrix
The inverse matrix reverses a matrix multiplication.
Formula
7. Determinant
The determinant measures whether a matrix is invertible.
Formula
For a 2×2 matrix,
8. Rank
The rank is the number of linearly independent rows or columns.
Formula
9. Trace
The trace is the sum of diagonal elements.
Formula
10. Dot Product
Measures similarity between two vectors.
Formula
11. Matrix Norm
Measures the size of a matrix.
Frobenius Norm
12. Vector Norm
L1 Norm
L2 Norm
Infinity Norm
13. Cosine Similarity
Measures similarity between two vectors.
Formula
14. Eigenvalues
Eigenvalues describe how a matrix scales an eigenvector.
Formula
Characteristic Equation
::contentReference[oaicite:1]{index=1}
15. Eigenvectors
An eigenvector keeps its direction after matrix multiplication.
Formula
16. Singular Value Decomposition (SVD)
Factorizes a matrix into three matrices.
Formula
where
- = Left singular vectors
- = Singular values
- = Right singular vectors
Summary
| Concept | Formula |
|---|---|
| Vector |