Decompose an image matrix with the SVD and read its singular values in the sandbox, and predict — before the screen tells you — how many σi are non-zero, how much energy the top k capture, and how the rank-k reconstruction error falls as k rises.
The singular value decomposition A = UΣV⊤ writes any matrix as a sum of rank-one layers σi ui vi⊤ ordered by how much they matter. The number of non-zero σi is the rank; the energy the top k capture is (Σi≤k σi2) / (Σi σi2); and by the Eckart–Young theorem, keeping the top k layers is the best possible rank-k approximation in Frobenius norm.
Open the sandbox. Choose the image “Rank 5 by construction” and leave the defaults (size 64×64, no noise, seed 1). Each step names the rank k to set; read the singular-value spectrum, the explained-energy readout and the measured reconstruction error.
Image = Rank 5 by construction size = 64x64 noise = 0 seed = 1
Read: sigma_1..sigma_l explained energy at k ||A - A_k||_F / ||A||_F
Watch the singular-value bar chart, the “energy kept” percentage and the measured error printed above the reconstruction — every number you predict is on screen.
Decompose the image and look at the singular-value spectrum. Predict how many σi are genuinely non-zero — that count is the matrix rank — then read the numerical rank off the chart.
Exactly 5 singular values are non-zero and the rest sit at the floating-point floor: the numerical rank is 5, which is why this image is called “rank 5 by construction”.
Set k = 3 and read the “energy kept” readout — the fraction (Σi≤3 σi2) / (Σi σi2). Predict whether three of five layers already capture most of the energy.
The top 3 of the 5 layers already capture 0.9939 of the energy — over 99%. The singular values fall off so fast that the first few layers carry almost everything.
Set k = 4 and read the measured relative error ||A - Ak||F / ||A||F. Then push k to 5 and predict what happens to the error.
At k = 4 the relative error is 0.0528 — about 5% still missing because one non-zero layer is dropped. At k = 5 the error falls to the floating-point floor: rank 5 reproduces the matrix exactly.
Everything above is waiting in the sandbox. Pick any image, drag the size, noise and rank k sliders, and watch the singular-value spectrum, the explained energy, the rank-one layers and the measured reconstruction error all update at once.
- Read a matrix's rank as the count of non-zero singular values, 5
- Saw the top 3 layers capture 0.9939 of the energy — over 99%
- Measured the rank-4 error at 0.0528, then watched it vanish at rank 5 — exact recovery
- Every value you predicted is the demo's own SVD arithmetic, not a picture