Interactive figures
Every figure in the track. Each one is a small experiment: drag, slide, and watch the numbers. The link under each figure takes you to the lesson that explains it.
Lesson 0 · Linear algebra in plain words
Drag the orange and blue tips. They are the columns of , the images of and . The green unit square goes to the parallelogram they span. Try the presets: a stretch, a rotation, a shear, a reflection, and a matrix that flattens the plane onto a line.
Drag to rotate the figure. Here lies in the plane of and , so it adds no new direction: the span (green) is only a plane, and the three vectors are dependent. Edit one entry of to lift it off the plane: the span becomes all of , and the three vectors form a basis.
Press Squash (play), or move the slider from 0 to 1. The grey cube is the input, the aqua shape is its image. With rank 2 the cube becomes a flat parallelogram inside a plane, and the orange null-space line shrinks to the point 0. Pick rank 3 (a solid box, nothing lost) and rank 1 (everything lands on one line, and a whole plane goes to 0).
Drag the orange tip and the blue tip . The thick segment is the shadow of on the line through . It is aqua when and magenta when , and it disappears when . Check that and always agree. Try perpendicular: .
Drag around the circle and watch . Usually points off the line through . For there are two directions where it does not: is stretched by , and is flipped, , so . Press Show eigenvectors to check. Then pick rotation 90°: no direction stays on its line.
Press ▶ Play, or step through the three factors. The shear turns the circle, stretches it to half-axes and , and turns it again. Its eigenvalues are and : singular values and eigenvalues are different things.
Drag the orange direction . Each point casts a shadow on the line through . The chart shows the variance of the shadows for every angle of : it is largest at PC1, the long axis of the cloud (about here), and smallest at PC2, perpendicular to it. Press Snap w to PC1 to jump there.
Lesson 1 · Matrices as maps, span and basis
Try it. Drag the orange and blue tips: they are the columns of , the images of and . The grey arrow is a test vector and is its image, built as . Use the presets for the five cases in the table below, and make the columns parallel to see the plane flatten.
Span in . Rotate the figure by dragging. With "v₃ in the plane", the third vector adds no new direction: the span stays a plane and the readout shows the dependency. Edit one entry of to lift it off the plane and the span becomes all of . The sliders move the thick dark arrow, the combination ; it can never leave the span.
One product, four readings. Switch the view and press Next part to step through the columns, rows, entries or rank-1 terms of for , . In the column view, each column of is a walk along the columns and of , so it stays in .
Lesson 2 · Rank and the four subspaces
Press Squash (play), or move the slider from 0 to 1. Every point moves from to . The aqua cube becomes a flat parallelogram in the plane , and the orange null-space line shrinks to the point 0. Read the count: rank 2 + nullity 1 = 3. Switch to rank 1: the image is a line and a whole plane of inputs goes to 0 (1 + 2 = 3). Edit the matrix: the count always gives 3.
All four subspaces of a matrix. On the left is the input space : the row space and the null space meet at a right angle. On the right is the output space : the column space and the left null space. Move with the sliders: it splits into , and only changes . Switch to rank 1 and watch every dimension in the table move by one.
Step through the elimination. Press Next step to apply one row operation at a time. Each operation acts on and on together, so the right block becomes the matrix with . Pivot columns and free columns are marked as soon as elimination decides them. At the end the widget reads off bases of all four subspaces, in the colours of the figures above; the last row of is the left null vector . Try needs a row swap, or type your own matrix.
Lesson 3 · Inverse, determinant and projection
Do it, then undo it. Press Apply A: the grid, the unit square and the letter F move to their images. Then press Apply A⁻¹: everything returns, because . Now pick singular: det 0. The magenta dots lie on one line , and sends all of them to the same point. No map can send one point back to five, so does not exist.
Signed area. Drag the orange and blue columns. The unit square becomes a parallelogram of area , and the F inside it grows by the same factor. Drag to the other side of : the turn arrow reverses, the F becomes a mirror image and . Make the columns parallel: the area is 0 and the plane collapses onto a line.
Drag the orange tip and the blue tip . The thick segment is the shadow of on the line through : aqua when , magenta when . The readout compares with . Notice that the shadow is never longer than itself: that is Cauchy–Schwarz. The two lengths are equal only when lies on the line through (try opposite).
Drag the orange tip and the black tip . The violet arrow is the point of the line closest to , and the magenta error meets the line at a right angle, so . The readout follows the two steps above. Try b on the line () and b ⟂ a ().
Project onto a plane. The green patch is for the columns and of section 4(c). Drag the figure to rotate it, and move with the sliders. The projection lies in the plane, and the error always meets the plane at a right angle, so . Switch to a line for section 4(b), and to plane, the wrong way to see that the sum of the two line projections misses when .
Lesson 4 · Orthogonal matrices and change of basis
Drag , or drag the basis vectors. The green grid is the coordinate grid of the basis , . The dashed walk reaches with steps along and steps along , where . Notice that stays where it is: only its coordinates change. Make and parallel and the coordinates stop existing.
Drag the basis vectors and watch . The map is of section 4(b). Column of holds the new coordinates of , drawn as a dashed walk. The table shows what never changes (green) and what changes (magenta). Choose eigenvectors, or drop and on the dashed lines: becomes . Choose orthonormal: now the singular values stay the same too.
Press Next step four times. The left panel shows coordinate vectors (black , violet output); its orange and blue axes mean "steps along " and "steps along ". The right panel shows the same arrows in standard coordinates. Watch , then see the shortcut land on the same point. Drag and change the basis: the shortcut always agrees, but is diagonal only for the eigenvector basis .
Drag and , or change . The default is the rotation of section 4(c), with and . Notice that lengths, the dot product and the angle stay the same (green), and the unit circle maps onto itself. Switch to the reflection : still , but and the F is mirrored. Then try not orthogonal to see everything change (magenta).
Lesson 5 · Eigenvalues and Jordan form
Drag around the circle. The violet arrow is ; the dashed magenta piece is its sideways part, and the chart below plots that part for every direction of . Its zeros are the eigenvector directions: for the default matrix there are two, with and (there points backwards). Then try the rotation (the curve never crosses 0) and the shear (it only touches 0 once).
Slide the entry and watch the roots. The violet curve is ; its crossings with the -axis are the eigenvalues (orange and blue dots). The lower panel shows the same two roots in the complex plane. Move from 2 down to : the crossings move together, meet at the lowest point (), and then leave the real line as a complex pair . Try rotation 90° and rotate and scale.
Press Step and watch the dots line up. has the eigenvectors and of the example in section 2, with eigenvalues you set. The chart shows the sine of the angle between and the dominant eigenvector on a log scale: close to a straight line, because each step multiplies it by about (the dashed reference line). Try 1 and 0.9: about 0.05 digits per step. Try the tie : no convergence. Make the dominant negative: flips sign every step, but its line converges.
Slide toward 0. The two eigenvector lines of close up like scissors, and at only one is left: the Jordan block. The right panel shows the eigenvalues : they meet at 2 and, for , turn into a complex pair. Press : the matrix barely changed, yet the eigenvalues moved by and .
Lesson 6 · Spectral theorem and Rayleigh quotient
Change , , in . The violet ellipse is the image of the unit circle. Its axes are always the eigenvectors and , at a right angle, with half-lengths and . Drag : the two faint arrows build from its pieces along and . Compare with a non-symmetric matrix in lesson 05: there the directions that only stretch need not be perpendicular.
Move the slider and watch the violet arrow. is a symmetric matrix and is its top eigenvector. The aqua patch is the plane . As walks around the unit circle of this plane, never leaves the plane: the image of the circle is an ellipse inside the plane. Switch to not symmetric: is still an eigenvector of , but now leaves the plane (the dashed magenta segment is its height ).
Drag around the circle and watch the chart. For a unit , is the part of along (thick violet). The sideways part (dashed magenta) is : it points to where grows. It vanishes only at the eigenvectors, where the chart has its max and its min . The bar shows the weights and of the weighted average. This is the "sideways part" of lesson 05, now with a meaning: a gradient.
Turn and tilt the plane . Here , so the eigenvectors are the axes. The blue plane is , where . However you move the orange plane , it shares a magenta line with , and the readout shows . Press best plane to reach . Switch to a line (): is not more than 3, and the line usually meets only at 0.
Move and watch the paths stay in their cones. is a fixed symmetric matrix with eigenvalues , and is symmetric with . Each coloured path is ; each shaded cone is Weyl's interval . Press E = I to touch the cone edges, and New random E to see a typical perturbation use less of its budget. Then switch to not symmetric: the eigenvalues leave the cone at once.
Lesson 7 · Positive definite matrices and Cholesky
Change , , in and drag to rotate. The surface is the energy : aqua where it is positive, magenta where it is negative. The arrows on the floor are the eigenvectors and . Go from bowl to trough to saddle and watch cross 0. Then try : positive entries, but a saddle.
Edit an entry or pick a preset; all five tests run at once. For a PD matrix all five pass, and otherwise all five fail: they are one property seen five ways. Note how the pivots, the Cholesky radicands and the ratios are the same numbers. Try minors 0, 0, 0: the leading minors look harmless, but a principal minor is negative, so the matrix is not even PSD.
Switch between white noise z, μ + Lz, μ + √S z and both, and follow the magenta point. The round cloud of white noise becomes the aqua ellipse of . With both, the blue cloud () and the orange cloud () fill the same ellipse and have almost the same sample covariance, but the same lands in two different places. The violet arrows are the columns of the map; for the second one is vertical, because is lower triangular. Change and drag .
Compare two ellipses (blue) and (orange). Turn the grey handle : the dashed lines touch each ellipse at its width in that direction. For and , each is wider somewhere, so they are incomparable. Switch to S vs S + 0.8I (ridge) or posterior vs prior (a Kalman update): one ellipse sits inside the other, . Drag the half-axis handles to make your own pair.
Lesson 8 · The SVD
Press Play, or step through the three factors. turns the orange and the blue onto the axes, stretches the axes by and , and turns the ellipse into place: it ends on the dashed violet ellipse . Try diag(3, −2) and det < 0: the letter F comes out mirrored. The figure puts the mirror into (it could also go into ), never into . With rank 1 the circle is flattened to a segment.
Turn the pair with the slider, or drag the tip of . The magenta number is the angle between and . Find the turn where it is , then press Find the orthogonal images to check. Notice in the lower chart: at that same turn, reaches its maximum (or its minimum ). For the shear the answer is , not the eigenvector of . Try 2 × rotation: every pair works, because .
Move the rank slider. The middle image is , the sum of the first layers . The chart shows the singular values you keep, the grey ones you drop, and the relative error, which is exactly . Switch to axis-aligned blocks: a background and three rectangles need only rank 4, and the error drops to rounding level. The rotated square has the same kind of content but needs far more terms, because its edges are not aligned with the rows and columns. Set the third panel to k-th layer to see single rank-1 terms.
The same factors, read as . stretches along and without turning them; then moves the ellipse into place. Here , so is a reflection: the F is mirrored. Pick shear or symmetric to get a rotation instead.
Two planes: the input space of and the output space of . With the
matrix has rank 1. Drag : is its projection onto the line , and the dashed
magenta residual is perpendicular to it. In the input space, every point of the
thick violet line is a least-squares solution; is the one in the row
space, closest to 0. Drag along the line and compare . Then raise a little
(0.05): becomes invertible and jumps far away. Switch on the cut-off:
is treated as 0, as rcond does, and stays small at the price of a nonzero residual.
Lesson 9 · PCA and randomized SVD
Drag the orange handle to turn . Each grey point casts an orange shadow on the line; the blue segments are the distances to the line. The chart shows, for every angle, the shadow variance and the squared distances, summed and divided by like the variance. The two curves always add up to . Find the angle where the orange curve is highest, then press Show principal axes: it is PC1, and its height is .
Change one setting at a time. Here , so the singular vectors are the axes. With and , the single sample misses the top direction by about for this unlucky (grey). Set : two samples span a blue plane that almost contains , and the estimate is about from it. Set and : the weights become , and the single sample turns toward . Press Run 1000 draws: the median angle is about with , and about with or .
Drag the cloud by its mean , and change the spreads and the correlation. The orange and blue arrows are the principal axes ; the violet ellipses are one and two standard deviations. The dashed magenta line is the top eigenvector of the uncentered matrix : move the mean away from 0 and it turns toward the mean. Press Mean to 0 and it agrees with PC1 again. The readout checks Theorem 2: .
Each dot is one randomized SVD; the lines are means. The chart shows the spectral error of the rank- result divided by the best possible error (Eckart–Young), against the oversampling , for power iterations. With the slow spectrum, oversampling alone stays far from 1, while one power iteration almost reaches it. With the fast spectrum, about ten extra columns are enough. The noise floor case is the worst for . Here is : the algorithm only multiplies by and , and a rotated Gaussian matrix is still Gaussian, so the errors have the same distribution for with any orthogonal and .
Lesson 10 · Factorizations and LU
Eigenvectors are not singular vectors. The dashed circle is the unit circle and the aqua ellipse is its image under ; drag the grey dots (the columns of ) to change it. The blue arrows are the SVD: orthonormal (faint) go to the ellipse axes . The violet lines are the eigenvector directions, where only stretches. Try symmetric: the two pictures agree. Try triangular, nearly defective and shear: the eigenvectors close up and then collapse to one line, while the singular vectors stay orthogonal. With rotation there is no real eigenvector at all. In every case .
Step through elimination. Each Next step subtracts a multiple of the pivot row from a lower row. The multiplier goes into at the same position, and a zero appears in . The readout shows that the equation holds after every step, not only at the end. Try zero pivot: without row exchanges elimination stops although is invertible; with partial pivoting it finishes, and every . The 4×4 case shows how a swap also moves the multipliers already stored in .
Shrink the pivot. The system has solution for every small , and : the problem is easy. Move the slider. Without a row exchange the multiplier is , has entries of size , and the error follows the dashed line until no correct digit is left. With partial pivoting the multiplier is and the answer is correct to the last bit. The failure is in the algorithm, not in the problem.
Answer the two questions on the left; the card on the right gives the factorization. It shows the cost of factoring once, the cost of each later use, the NumPy/SciPy call and the reason. Change one answer at a time and see which property of the matrix changes the choice. Then answer the Check yourself scenarios at the bottom before you read the explanation.
Lesson 11 · Norms of vectors and matrices
Change and watch the ball. The green region is the unit ball of ; the thin outlines are the , and balls. As grows, the ball grows from the diamond to the square. Move below 1: the ball becomes a star, and the midpoint of and falls outside it. A set that does not contain the midpoints of its points is not convex, so for the formula is not a norm. Drag to see .
Inflate the balls. Press Inflate to grow the , and balls until each touches the line of section 1. The touching points are the minimizers. Drag the grey points to tilt the line: the answer jumps from one axis to the other but always keeps a zero coordinate, while the answer moves smoothly and has no zeros.
Move and . Top: the lasso objective with its minimizer, the ridge objective with its minimizer, and the two slopes of at the kink. Bottom: the output against the input . Move into the band : the left slope becomes and the right slope , so the lowest point of sits exactly at the kink and the lasso output is exactly 0. The ridge output only gets smaller.
Where the ellipse meets the ball. The grey ellipses are level sets of the least-squares loss around . The solution under a constraint is the point where the smallest ellipse reaches the diamond (lasso) or the disk (ridge). Drag around: for a large range of positions the lasso answer sits on a corner, with one weight exactly 0, while the ridge answer only shrinks. Make large enough and both answers equal . The tilt slider turns the ellipses (correlated features).
The largest stretch. The grey region is the unit ball of and the green region is its image under . The dashed ball has radius : it is the smallest -ball around the image, and it touches the image at . For the maximizer is a corner (largest column sum); for it is a corner (the signs of the largest row); for it is . The matrix is half of the one in section 4, so every norm is half as large.
Lesson 12 · QR and least squares
Least squares is a projection. The green plane is , spanned by the columns and . The vector is not in the plane, so has no solution. The closest point is , and the residual meets the plane at a right angle: . Rotate the figure and move with the sliders. With line through 3 points, the same picture fits a line to three data points: the three values are one vector in .
Step through Gram–Schmidt. Press Next step. The grey arrows are the columns of : the two vectors above and . At each step the magenta vector is what is left of a column after its parts along the earlier 's are removed (dashed); then it is normalized to , or . Watch fill in column by column. Then choose nearly dependent, set , go to the last step and switch between CGS and MGS: CGS gives a that is away from orthogonal to .
Reflect onto the axis. The mirror is the line orthogonal to . Reflecting across it gives , a point on the axis at distance from 0. Drag close to the positive axis and switch to other sign: becomes very short, which is where cancellation hits in floating point (the readout repeats the example in real double precision). Givens rotation reaches the axis by turning instead of reflecting.
Four QR algorithms, one test. Each dot is a random matrix with condition number , factored in double precision by classical Gram–Schmidt, modified Gram–Schmidt, Cholesky QR ( from the Cholesky factor of , then ) and Householder. The dashed lines are and . CGS and Cholesky QR follow and reach order 1 near (Cholesky QR then breaks down: is no longer numerically positive definite). MGS follows . Householder stays at . Move the slider: the table shows that all four have a tiny residual .
Fit a line, then try to beat it. The model is , so has the columns and . Drag the data points. The least-squares line keeps : the residuals add up to 0, and so do the . Switch to your own line and drag its two grey points: is no longer 0, and by the Pythagoras step of the proof its is always at least the least-squares value, with equality only on the least-squares line.
Lesson 13 · Floating point and conditioning
Click the bits or type a number. The sign, exponent and fraction bits are decoded step by step below them. Try largest (65504 in fp16), then ∞: all exponent bits are 1 and the fraction is 0; flip one fraction bit of and you get NaN. Type 0.1 and look at the stored value: 0.1 has no finite binary expansion. Switch to bf16: the same number gets 8 exponent bits and only 7 fraction bits.
Move or pick a preset. The top chart is the gap between neighbouring floats near : a staircase that doubles at every power of 2, for bf16, fp16 and fp32. The bottom rows draw the representable numbers of each format in the same small window around ; the dot is where is stored. Try 2049 (fp16 cannot store it), 1e−8 (fp16 underflows to 0) and 70000 (fp16 overflows).
Drag in the small disk. The two equations of are the orange and blue lines, and is where they meet. Changing shifts both lines in parallel (dashed), and the intersection moves to . The violet ellipse holds every possible for . Make small: the lines become nearly parallel, the ellipse stretches like , and the amplification approaches when you press Worst δb.
Pick a formula and move the probe. Each dot is the true relative error of one evaluation in double precision (the exact values come from 100-digit arithmetic). The naive formula follows the dashed bound up to error 1; the stable rewrite stays at the level of for every input.
Change the term and the number of additions. Each line is a running sum rounded after every addition: bf16, fp16 and fp32. On these log–log axes the exact sum is the grey diagonal, and a sum that stops growing becomes a horizontal line: fp16 at 2048 and bf16 at 256 for . The violet line keeps the inputs in bf16 but the running sum in fp32 (as tensor cores do); it stays on the diagonal.
Drag the computed answer in the left panel. The right panel shows the data: and , the data for which is exact. The violet ellipse holds every answer with the same backward error as . It is times longer than it is wide. Press error along v₂: a tiny change of the data explains a large error in the answer. Raise and watch the ellipse stretch.
Lesson 14 · Eigenvalue algorithms and Krylov methods
Move the shift . All three methods start from the same vector of a symmetric matrix. Power iteration falls at the slow rate (0.96 for the second spectrum). Inverse iteration finds the eigenvalue closest to (the blue dot on the strip) at the rate : put near an eigenvalue and the line gets steep; put it halfway between two and it crawls. Rayleigh quotient iteration updates its shift every step and needs only a few.
Press Run, then change the shift. The chart follows the subdiagonal entries of on a log scale, and the heat map shows (stronger colour = larger ). Without a shift each entry decays at its own rate (dashed) and the whole run takes about 100 steps. With the Rayleigh or Wilkinson shift the corner entry drops below in a few steps, the block deflates (dashed frame), and the next corner starts: all four eigenvalues take 13 steps with the Rayleigh shift and 7 with the Wilkinson shift. Try the zero-diagonal matrix: the Rayleigh shift is 0, so the corner does not move until rounding errors break the symmetry (the first eigenvalue deflates after about 37 steps); the Wilkinson shift finishes in 8.
Move , then switch to the Hessenberg view. Top: the condition number of the plain basis (each vector scaled to length 1) grows by about 6 times per step and comes close to (numerically singular) by ; the Arnoldi basis spans the same space and keeps . Bottom: the angle between and the top eigenvector falls toward 0. In the Hessenberg view, press Next step: each Arnoldi step adds one column to . Switch to a symmetric matrix and the entries above the first superdiagonal become 0.
Move or press Play. Each column holds the Ritz values of a symmetric matrix after Lanczos steps; the ticks on the right are its eigenvalues. The isolated eigenvalues 2.0 and 1.5 are found first, then the edges of the dense block ; the interior never converges in 60 steps. Switch off reorthogonalization and go past : a stray Ritz value climbs up and becomes a second copy of 2.0 (a ghost).
Change the spectrum and move . The blue curve is the CG polynomial : it starts at and its roots (blue dots) are the Ritz values. CG makes small at the eigenvalues (the ticks). The orange scaled Chebyshev polynomial is the best one can do knowing only ; the dashed lines at give the bound. With 3 distinct values CG is exact after 3 steps; with outliers three roots go to the outliers first, and then CG converges as if were 2.
Drag and raise . On the contours of , steepest descent zigzags: each step stops where its line touches a contour, so the next gradient is perpendicular to it. CG takes the same first step, then a direction that is -conjugate to it, and reaches after 2 steps (). The default start is the worst case for : steepest descent meets its bound .
Lesson 15 · Autodiff, LoRA, tensors, attention
Build the Jacobian one pass at a time. Press Run all passes in both modes. A forward pass (JVP) with gives column of ; a reverse pass (VJP) with gives row . For a scalar loss () one reverse pass gives the whole gradient. Switch to the simulator shape ( inputs, outputs) and forward mode wins.
Choose the order and press Next product. The blocks are drawn to scale (height = rows, width = columns); the highlighted pair is multiplied next. With the loss shape, reverse needs 224 multiplications and forward 1632. Switch to the simulator shape (2 inputs, 12 outputs): now forward is cheaper. The readout also gives the cheapest order of all.
Spend a rank budget. Move the rank slider . The middle map is the best rank- matrix (the truncated SVD), and the right map is what it misses. When the singular values of the target update decay fast, a small captures almost all of it with parameters. Choose flat and low rank fails: the relative error falls only like .
Choose a mode and press Next fiber. The coloured lines in the cube are the mode- fibers; the black one is the selected fiber, and it becomes the outlined column of the unfolding below. With counting 1…24, the mode-1 columns read the numbers in order. Choose ranks differ: the three unfoldings have ranks , so the entries of the multilinear rank need not be equal.
One head, six tokens, . The readout shows but : the low rank is in the logits, not in . Move the scale (an inverse temperature) to 0: every row of becomes uniform, has rank 1, and the output is the mean of the values. Move it up: the rows become nearly one-hot and the output jumps to one value vector. Turn on the causal mask and pick : the first token can only attend to itself.
Lesson 16 · Matrix calculus and matrix functions
Choose a function and press New direction. The blue curve uses the correct derivative and falls with slope 2. The orange curve uses a common mistake ( instead of , instead of , instead of ) and falls only with slope 1. For the function is linear, so the correct prediction is exact and only rounding error is left.
Match the blocks. Press Next block or click a block of . Block is . It multiplies column of (the same colour in ), and block row adds up to column of . Press New numbers: the check at the bottom always says equal.
The gradient is perpendicular to the level sets. Drag the violet point . The blue arrow is the true gradient ; it crosses the green contour lines at a right angle. The orange dashed arrow is : for a non-symmetric it points in another direction. Choose I + skew part: the contours are circles, yet is turned by a fixed angle. Switch the arrow field to to see the error everywhere.
Move the logits and the temperature. The bars are the probabilities ; the map is (orange positive, blue negative). The row sums are always 0. The preset is worked example (b). Lower the temperature : becomes one-hot and every entry of goes to 0, which is why a saturated softmax passes almost no gradient.
Let the plane flow. Press Play or move . Every point moves along ; the green ring is the unit circle carried by , and it stays an ellipse because is a linear map. Try the presets: real eigenvalues give straight eigen-directions (dashed), complex ones give spirals (closed ellipses for the center, where ), a saddle stretches along one eigen-direction and squeezes along the other. The readout shows that and are the same number.
Lesson 17 · Perturbation theory
Shrink the gap. Here and . On the left, the blue dashed ellipse is the unit circle mapped by , the orange one is mapped by ; the arrows are their long axes and . Move below : the ellipse becomes a circle and turns by almost , while the eigenvalues move by less than . On the right, the true (orange) is about for large gaps, where it almost touches the classical bound (aqua), and it levels off at for small gaps. Both Davis–Kahan bounds of section 3 stay above it; the bound (violet) is twice as large for large gaps.
Each eigenvalue stays in its own interval. Row shows of an symmetric (blue), the interval (aqua) and of (orange). Increase and press New noise: the orange dot never leaves its interval, even when neighbouring intervals overlap. Choose to see that the bound is reached, and a rank-one to see every eigenvalue move up.
A non-normal matrix amplifies noise. The orange dots are the eigenvalues of in the complex plane. They sit on the violet circle of radius , far outside the aqua disc that Weyl and Bauer–Fike give for a symmetric or normal matrix (for small this disc is so small that it hides under the blue dot at 0). Make larger or smaller and read the amplification. Switch to a random with the same norm: the eigenvalues still spread around a circle of about the same size (usually a little smaller, because only part of the norm of sits in the corner entry).
Turn and tilt . Blue is (the -axis, or the -plane), orange is . The readout computes the singular values of and the principal angles. With two planes, the magenta line is the shared line, and always; the arc shows . With line and plane, the dashed segment drops the line onto its shadow. For equal dimensions the readout also checks .
Lesson 18 · Sketching, JL and random matrices
Project 50 points from to . The histogram shows, for all 1225 pairs, the squared distance after the projection divided by the squared distance before. The violet curve is its exact law : it does not depend on the points or on . Move : the spread shrinks like . Below , Theorem 3 (without the term) gives no ; above it the aqua lines show , and the whole histogram almost always stays inside them (press New points a few times: the union bound is pessimistic).
Pure noise is not flat. Each data set has samples of independent features, so every true eigenvalue is 1. The histogram pools the eigenvalues of from four data sets; the violet curve is the Marchenko–Pastur density for . Move : the bulk widens to , and for part of the spectrum is exactly 0. Then add a spike (Theorem 5 below): its orange top eigenvalues leave the bulk only when .
Move and watch the ellipse. The dashed circle is the set of unit vectors of the plane. The orange ellipse shows the same vectors at the length ; its half-axes are the singular values of . The aqua ring is the band . Drag the blue vector: its image (violet) always lies on the ellipse. For , the ellipse leaves the ring in about one draw out of three at , and almost never at . Press New S a few times, or Run 1000 draws to count.
Raise the dimension. Left: the norms of 300 random Gaussian vectors , divided by . Right: the angles between the 4950 pairs among 100 of them. The violet curves are the exact densities. As grows, stays at with a standard deviation of about , whatever is, so piles up at 1. The angles pile up at with a spread of about . In every angle is equally likely; in no pair is more than a few degrees from orthogonal.
Lesson 19 · Structured matrices in ML
Pick a kernel, then move the mode . The heatmap is the circulant built from the first column ; hover over a cell to see that is constant along each wrapped diagonal. The blue dots are a Fourier mode (real part), the violet squares are , computed as a matrix–vector product. They always form the same wave, only scaled by and shifted in phase: , with . Try "shift P": all eigenvalues lie on the unit circle. Try "difference": is not symmetric, so most eigenvalues are complex.
Colour the graph by an eigenvector of . Nodes are orange where and blue where . For (the Fiedler vector) the signs cut the two clusters apart along the single bridge. Click the bridge to remove it: a second eigenvalue drops to 0, one per connected component. Raise and the vector changes sign more often. "Signal kept on " projects a noisy signal onto the smoothest eigenvectors: a low-pass filter on the graph. Try the karate club: the Fiedler vector almost predicts how the club split in 1977.
Follow both paths around the square. Right, then down: (dashed outlines). Down, then right: (filled bars). The layer is equivariant when they match, and the relative error is then 0 or at round-off level. Compare circular and zero-padded convolution, a convolution that also sees the position, and a dense layer. Then switch to "relabel graph nodes": a GCN layer passes the test only if the adjacency matrix is relabeled together with the features.
One Fourier layer with one channel. Move : the layer keeps the blue modes, drops the grey ones and multiplies mode by . Then change the grid size : the violet dots (the output on your grid) stay on the violet curve (the same layer on a 1024-point grid), because belongs to frequencies, not to grid points. Choose "smooth + high modes" with to see the limit: modes above alias onto the kept modes and the output changes. With "step", the truncation gives the Gibbs ripples.
Choose a propagation matrix, then add layers. The blue curve is the response after layers; the orange dots are the eigenvalues of the chosen graph (the violet dot has the largest ). With "2I − L_sym" (step 4) the eigenvalue 2 at makes the response grow like . With "I − L_sym" a bipartite graph (path, ring, star) has , which never decays. With the renormalized (step 5) every other eigenvalue shrinks to 0 as grows: only the top eigenvector survives. This is over-smoothing.
Take steps on the sphere. At the black point the grey arrow is the gradient of , . The blue arrow lies in the aqua tangent plane. The orange step ends at , slightly outside the sphere; the violet point is the retraction . Press Take one step a few times: moves to the minimizer , the top eigenvector of . Drag to rotate the view.