ball-blog
  • Welcome, I'm ball
  • Machine Learning - Basic
    • Entropy
    • Cross Entropy
    • KL-Divergence
    • Monte-Carlo Method
    • Variational Auto Encoder
    • SVM
    • Adam Optimizer
    • Batch Normalization
    • Tokenizer
    • Rotary Positional Encoding
    • Vector Quantized VAE(VQ-VAE)
    • DALL-E
    • Diffusion Model
    • Memory Layers at Scale
    • Chain-of-Thought
  • Einsum
  • Linear Algebra
    • Linear Transformation
    • Determinant
    • Eigen-Value Decomposition(EVD)
    • Singular-Value Decomposition(SVD)
  • AI Accelerator
    • CachedAttention
    • SGLang
    • CacheBlend
  • Reinforcement Learning
    • Markov
  • Policy-Improvement Algorithm
  • Machine Learning - Transformer
    • Attention is All you need
    • Why do we need a mask in Transformer
    • Linear Transformer
    • kr2en Translator using Tranformer
    • Segment Anything
    • MNIST, CIFAR10 Classifier using ViT
    • Finetuning PaliGemma using LoRA
    • LoRA: Low-Rank Adaptation
  • EGTR: Extracting Graph from Transformer for SGG
  • Machine Learning - Mamba
    • Function Space(Hilbert Space)
    • HIPPO Framework
    • Linear State Space Layer
    • S4(Structures Space for Sequence Model)
    • Parallel Scan Algorithm
    • Mamba Model
  • Computer System
    • Memory Ordering: Release/Acquire 1
    • Memory Ordering: Release/Acquire 2
    • BUDAlloc
    • Lock-free Hash Table
    • Address Sanitizer
  • App development
    • Bluetooth connection in linux
    • I use Bun!
    • Using Tanstack-query in Frontend
    • Deploying AI Service using EC2
  • Problem Solving
    • Bipartite Graph
    • Shortest Path Problem in Graph
    • Diameter of a Tree
  • Scribbles
Powered by GitBook
On this page
  • Eigen Values and Eigen Vectors
  • Eigen-Value Decomposition
  • Special Case when A is symmetric square Matrix
  • References

Was this helpful?

Edit on GitHub
  1. Linear Algebra

Eigen-Value Decomposition(EVD)

Last updated 1 month ago

Was this helpful?

Eigen Values and Eigen Vectors

Let's say we have matrix A∈Rn×nA \in \mathbb{R}^{n\times n}A∈Rn×n.

The solutions x∈Rn×1x \in \mathbb{R}^{n \times1}x∈Rn×1 and λ∈R\lambda \in \mathbb{R}λ∈R for the following equation are called eigen vectors and eigen values.

Ax=λxAx=\lambda xAx=λx

Eigen-Value Decomposition

We are trying to decompose square-matrix A∈Rn×nA \in \mathbb{R}^{n \times n}A∈Rn×n. Let's define a notation Λ\LambdaΛ as diagonal matrix that diagonal elements are eigen-values.

Due to the definition of eigen-values and eigen-vectors, we can write the equation as following:

Ax1=λx1Ax2=λx2Ax3=λx3...A \mathbb{x}_1=\lambda\mathbb{x}_1 \\ A \mathbb{x}_2=\lambda\mathbb{x}_2 \\ A \mathbb{x}_3=\lambda\mathbb{x}_3 \\ ...Ax1​=λx1​Ax2​=λx2​Ax3​=λx3​...
A[∣∣∣∣x1x2x3...xN∣∣∣∣]=[∣∣∣∣x1x2x3...xN∣∣∣∣][λ100000λ200000λ300000...00000λN]A\begin{bmatrix} & & & & \\ | & | &| & & | \\ \mathbb{x}_1 & \mathbb{x}_2 & \mathbb{x}_3 & ... & \mathbb{x}_N \\ | &| &| & & | \\ & & & & \end{bmatrix} = \begin{bmatrix} & & & & \\ | & | &| & & | \\ \mathbb{x}_1 & \mathbb{x}_2 & \mathbb{x}_3 & ... & \mathbb{x}_N \\ | &| &| & & | \\ & & & & \end{bmatrix} \begin{bmatrix} \lambda_1 & 0 & 0 & 0 &0 \\ 0 & \lambda_2&0 & 0 & 0 \\ 0 &0 & \lambda_3& 0 &0 \\ 0 & 0 & 0 & ... & 0 \\ 0 & 0 & 0 & 0 & \lambda_N \end{bmatrix}A​∣x1​∣​∣x2​∣​∣x3​∣​...​∣xN​∣​​=​∣x1​∣​∣x2​∣​∣x3​∣​...​∣xN​∣​​​λ1​0000​0λ2​000​00λ3​00​000...0​0000λN​​​

AX=XΛAX=X\LambdaAX=XΛ

If we apply inverse of XXX to each side, we get the following equation:

A=XΛX−1A=X \Lambda X^{-1}A=XΛX−1

Special Case when A is symmetric square Matrix

There is a special case for EVD.

If Matrix AAA is symmetric and square and have distinct eigen-values, then we can express EVD as follows:

A=XΛXTA=X\Lambda X^TA=XΛXT

Proof of the special case

We just have to prove that X−1=XTX^{-1}=X^TX−1=XT, which means XXX is orthogonal matrix.

λ1v1⋅v2=Av1⋅v2=Av2⋅v1=λ2v2⋅v1=λ2v1⋅v2 ...(1)\lambda_1v_1 \cdot v_2 = A v_1 \cdot v_2 = A v_2 \cdot v_1 = \lambda_2 v_2 \cdot v_1 = \lambda_2 v_1 \cdot v_2 \ ...(1)λ1​v1​⋅v2​=Av1​⋅v2​=Av2​⋅v1​=λ2​v2​⋅v1​=λ2​v1​⋅v2​ ...(1)

From equation (1), we can derive following:

λ1v1⋅v2−λ2v1⋅v2=(λ1−λ2)v1⋅v2=0\lambda_1 v_1 \cdot v_2 - \lambda_2 v_1 \cdot v_2 = (\lambda_1 - \lambda_2) v_1 \cdot v_2 = 0λ1​v1​⋅v2​−λ2​v1​⋅v2​=(λ1​−λ2​)v1​⋅v2​=0

Since we assumed matrix AAA have distinct eigen-values, we can derive v1⋅v2=0v_1 \cdot v_2=0v1​⋅v2​=0

So we can say that X−1=XTX^{-1}=X^TX−1=XT

References

[1]

https://angeloyeo.github.io/2020/11/19/eigen_decomposition.html
Important components of EVD
Drawing