Truncated SVD
A rank-k truncated SVD is the sum of the k leading weighted singular-vector outer products.
On this page 9 sections
01A large matrix can contain patterns that repeat across many entries#
A large matrix can contain patterns that repeat across many entries. Truncated SVD stores an approximation using only the strongest patterns. Each retained component has one pattern across rows, one across columns, and a strength. Their outer product fills a whole matrix.
For an image, entries can be brightness values. A few components may reproduce broad structure while omitting detail. For other matrices, entries might be measurements rather than pixels. This lesson reconstructs a matrix from supplied components; computing those components is a separate numerical task.
An SVD writes a matrix as weighted rank-one pieces. A rank- truncation keeps the largest singular scales and their matched vector pairs. Each retained piece contributes a whole matrix.
For leading scale 5, and , compute every product . The first column is and the second is zero.
Build a rank-one term in two steps. For and , the outer product has first row and second row . Multiplying every entry by the singular value 5 gives rows and . Do not multiply only the diagonal.
Leading singular scale , , . Other scales are smaller. Give rank-1 approximation rows.
Show answer and explanation
Each entry is .
02Keep large components, not small ones#
Keep large components, not small ones. If scales are 6 and 2, the rank-1 truncation keeps . Keeping the other term is a different matrix, even though it also has rank 1.
Scales ; , ; , . Claim: keep term 2 for rank 1. Repair rows.
Show answer and explanation
Keep scale : .
03To keep two components, add both weighted matrices#
To keep two components, add both weighted matrices. If unit outer products have rows and , scales give rows . Keeping every nonzero component recovers the original matrix.
For two components, make two weighted matrices before adding. If has rows and has rows , then and have rows and . Entrywise addition gives . Keep each scale paired with its own two vectors.
Two leading scales . Unit outer-product rows: : ; ; : ; . Keep both: rows?
Show answer and explanation
Sum .
04Explore the visual intuition#
Truncating to the largest singular values gives a best approximation of rank at most in Frobenius norm. A small matrix error is useful for compression, but does not guarantee that the lost detail is unimportant for a particular prediction task. The next lesson measures exactly how much squared matrix error was discarded.
Keep the largest singular scales and matched vector pairs. Add their weighted outer products entry by entry.
- Construct a rank-k approximation from supplied singular components.
Further questions
How much matrix information was discarded?
Sources & further reading
- [1]Jay Gopalakrishnan, The Singular Value Decomposition ↗Textbook · Book