Linear Algebra

Dive into Deep Learning · §33

Linear Algebra: Geometry, Spectra, and Low-Rank Structure
projections · linear maps · eigendecompositions · spectral stability · singular value decomposition

Why Deep Learning Needs Geometric Linear Algebra

Motivation

  • Beyond Mechanical Multiplication: Viewing \mathbf{X}\mathbf{W} geometrically reveals what a layer preserves, collapses, or amplifies in \mathbb{R}^d.
  • High-Dimensional Intuition: Dot products carry lengths, angles, and orthogonal shadows into 784-pixel images or 4096-D embeddings.
  • Choosing Natural Axes: A matrix becomes transparent along orthonormal subspace bases, eigenvectors, or singular vectors.

Two-Stage Roadmap: Single Maps to Natural Axes

Chapter Structure

  • Stage 1: Standard Coordinates (§§33.1–33.2): Measure similarity, project onto subspaces (\mathbf{P} = \mathbf{Q}\mathbf{Q}^\top, \mathbf{A} = \mathbf{Q}\mathbf{R}), and track surviving vs. collapsed dimensions (\operatorname{rank}\mathbf{A} + \dim\ker\mathbf{A} = n, \det\mathbf{A}).
  • Stage 2: Matrix-Tailored Coordinates (§§33.3–33.5): Diagonalize repeated square maps (\mathbf{A} = \mathbf{V}\boldsymbol{\Lambda}\mathbf{V}^{-1}), analyze power iteration and non-normal growth, and factor any m \times n matrix via SVD (\mathbf{A} = \mathbf{U}\boldsymbol{\Sigma}\mathbf{V}^\top).

Three Landmark Theorems of Chapter 33

Core Theory

  • 1. Orthogonal Projection (\mathbf{P} = \mathbf{Q}\mathbf{Q}^\top): The closest point in S leaves a residual \mathbf{y} - \mathbf{P}\mathbf{y} \perp S, turning least squares into a right triangle.
  • 2. Spectral Theorem (\mathbf{A} = \mathbf{V}\boldsymbol{\Lambda}\mathbf{V}^\top): Every real symmetric matrix has real eigenvalues and an orthonormal eigenbasis.
  • 3. Eckart–Young–Mirsky (\mathbf{A}_k): Truncating the SVD at rank k gives the optimal rank-k approximation in spectral and Frobenius norms.

Running Matrices and Empirical Benchmarks

Pedagogical Thread

  • Concrete 2 \times 2 Test Matrices: Running matrix \mathbf{A} (complex \lambda = 2 \pm i, \det = 5), defective shear \mathbf{T} (g = 1 < a = 2, linear drift), and rank-1 singular matrix \mathbf{B}.
  • Real High-Dimensional Data: Fashion-MNIST in \mathbb{R}^{784} (92\% nearest-mean hyperplane; non-isotropic cosines) and a 400 \times 500 cat photo (9\% rank-20 SVD storage at 8\% error).

How to Navigate This Chapter

Study Guide

  • First-Pass Essentials: Focus on orthogonal projections and 1/\sqrt{d} attention scaling (§33.1), column/null spaces and rank–nullity (§33.2), the spectral theorem and positive definiteness (§33.3), power iteration and transient growth (§33.4), and the full SVD / LoRA / conditioning workflow (§33.5).
  • What to Skim on First Reading: The axiomatic n-dimensional permutation determinant (§33.2), Gershgorin discs, PageRank, and \varepsilon-pseudospectra (§33.4) can be skipped without losing the main thread.
  • Real vs. Complex Spaces: We work in real vector spaces \mathbb{R}^d throughout, bringing in complex numbers \mathbb{C} only when real matrices like rotations or \mathbf{A} force complex eigenvalues.
  • Numerical Mindset: Every section pairs exact theorems with floating-point realities—why we clip cosines to [-1, 1], use QR/SVD instead of normal equations, call solve instead of inv, and threshold tiny singular values.

Up next (§33.1 Vectors, Angles, and Projections): How the dot product extends planar lengths, angles, orthogonal shadows, and separating hyperplanes to 784 dimensions.