1.1.15 · HinglishLinear Algebra Essentials

Singular Value Decomposition (SVD) intuition and computation

1,592 words7 min readRead in English

1.1.15 · AI-ML › Linear Algebra Essentials


SVD KYA hai?

YE HAMESHA KYO EXIST KARTA HAI (eigendecomposition ke unlike, jise square, diagonalizable matrix chahiye)? Kyunki hum ise aur se banate hain, jo hamesha symmetric aur positive semidefinite hote hain, isliye unke paas hamesha non-negative eigenvalues ke saath orthonormal eigenvectors ka poora set hota hai.


Ise scratch se KAISE derive karein

Hum chahte hain orthonormal directions jinhein map kare orthogonal directions mein.

Step 1 — dekho. Ye symmetric hai () aur PSD hai (). Spectral theorem ke hisaab se iske orthonormal eigenvectors hain aur eigenvalues hain:

Ye step kyun? Symmetric PSD ⇒ guaranteed orthonormal eigenbasis aur non-negative eigenvalues — bilkul wahi raw materials jo humein chahiye.

Step 2 — Singular values define karo.

Kyun? (neeche dekho), isliye — ek length hai, isliye non-negative. Yahan "stretch factor" rehta hai.

Check:

Step 3 — Left singular vectors define karo. ke liye set karo

Kyun? Ye ko unit length pe normalize karta hai. Aur ye orthonormal nikalta hai:

Step 4 — Dobara jodo. har ke liye matlab, columns stack karke, ( use karke kyunki orthogonal hai). ∎


Figure — Singular Value Decomposition (SVD) intuition and computation

Dual coding: unit circle (right singular vectors ) → se map hoke → ek ellipse jiske axes hain.


Geometric reading (picture)

ek vector par right-to-left kaam karta hai:

  1. ko rotate karta hai taaki singular directions ke saath align ho.
  2. axis ko factor se stretch karta hai (sphere ko ellipsoid bana deta hai).
  3. result ko output space mein rotate karta hai.

Worked example 1 — ek matrix

Maan lo .

Step 1: . Kyun? Hum hamesha se shuru karte hain. Step 2: eigenvalues , jiske saath . Step 3: , . Sign kyun? , toh normalize karne se woh flip hota hai — SVD sign ko mein absorb kar leta hai, rakhta hai. Result: .


Worked example 2 — ek non-square, rank-1 matrix

Maan lo ().

Step 1: . Kyun? Column-column dot products. Step 2: ke eigenvalues aur hain ⇒ . Rank 1 hai! ke liye eigenvector: . Step 3: . Kyun? ; se divide karne par unit vector milta hai. Result: — ek single rank-1 term, jaisa expected tha.


80/20: SVD kis kaam aata hai


Common mistakes (steel-manned)


Active recall

Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho ek stamp jo atta ka gol loa dabaa ke oval pancake bana deta hai. SVD kehta hai stamp ek ke baad ek teen saaf kaam karta hai: loe ko spin karo, use ek taraf doosre se zyada stretch karo, phir dobara spin karo. Stretch ki matra (oval ki baahein kitni lambi hain) singular values hain. Agar ek stretch bahut chhota hai, tum pretend kar sakte ho ke woh zero hai aur phir bhi almost wahi pancake milega — isi tarah computers photos ko compress karte hain.


Flashcards

mein teen geometric actions kya hain?
Rotate karo (), axes ke saath stretch karo (), dobara rotate karo ().
ke singular values kaise compute karte hain?
ke eigenvalues ke square roots lo (equivalently ke bhi).
Singular values hamesha non-negative kyun hote hain?
Ye ke barabar hain, jo ek length hai, isliye ; signs mein absorb ho jaate hain.
Right singular vectors kahan se aate hain?
ke orthonormal eigenvectors se.
aur diye hue, kaise nikaalte hain?
.
SVD har matrix ke liye exist kyun karta hai lekin eigendecomposition nahi karta?
hamesha symmetric PSD hota hai, isliye spectral theorem hamesha apply hota hai.
ka best rank- approximation batao.
(Eckart–Young); error .
SVD ka PCA se kya relation hai?
Centered ke liye, ke columns principal directions hain aur variances hain.
geometrically kya hai?
Image ellipsoid ki sabse lambi semi-axis = = operator (spectral) norm.
SVD eigendecomposition ke saath kab coincide karta hai?
Jab symmetric positive semidefinite ho.

Connections

  • Eigenvalues and Eigenvectors — SVD ke eigenpairs se bana hai.
  • Spectral Theorem — woh orthonormal eigenbasis guarantee karta hai jis par SVD rely karta hai.
  • Principal Component Analysis (PCA) aur ka direct application.
  • Orthogonal Matrices — kyun length preserve karte hain (pure rotations/reflections).
  • Matrix Norms, .
  • Pseudoinverse (Moore–Penrose).
  • Rank of a Matrix — rank = nonzero singular values ki sankhya.

Concept Map

factored as

contains

contains

contains

spectral theorem gives

eigenvalues lambda

sigma = sqrt lambda

u = Av over sigma

geometric reading

rank r truncation

ordered by

always PSD ensures

Matrix A

A = U Sigma V-transpose

U orthogonal - left singular vectors

Sigma - singular values

V orthogonal - right singular vectors

A-transpose A symmetric PSD

Stretch factors

Rotate then stretch then rotate

Sum of rank-1 pieces

SVD always exists