1.1 Vectors and matrices as transformations
1. Learn
Section titled “1. Learn”- 3Blue1Brown, Essence of Linear Algebrachapters 1–4 and 6: Vectors, Span, Linear transformations, Matrix multiplication, The determinant
- 3Blue1Brown, Dot products and dualitywhole lesson (chapter 9)
- Mathematics for Machine Learning (Deisenroth, Faisal, Ong)§2.2 Matrices (pp. 22–27), §2.7 Linear Mappings (pp. 48–61), §3.8 Orthogonal Projections (pp. 81–91), §3.9 Rotations (pp. 91–94)
2. Bridge
Section titled “2. Bridge”Read a matrix matrixA matrix, written bold upper-case. A_{ij} is row i, column j.Introduced in 1.1 Vectors and matrices as transformations. UDL writes weights as Ω (Omega) and biases as β; we use W and b. as a function that moves space, not as a grid of numbers. A linear map is fixed by where it sends the basis vectors, and those images are the matrix’s columns. So is “take of the first column plus of the second” (3Blue1Brown, ch. 3; MML §2.7). Multiplying matrices composes the maps: means “do , then ”, which is why order matters (3Blue1Brown, ch. 4).
The determinant determinantSigned factor by which A scales areas (volumes). Zero means A squashes space flat.Introduced in 1.1 Vectors and matrices as transformations. is the factor by which a map scales area (volume in 3-D). It is negative when the map flips orientation, and zero when it squashes space onto a line, so no inverse exists (3Blue1Brown, ch. 6; MML §4.1).
The dot product (transposeRows become columns: (Aᵀ)_{ij} = A_{ji}. xᵀy is the dot product.Introduced in 1.1 Vectors and matrices as transformations. is the transpose) measures how much points along . That gives the projection onto the line through : (3Blue1Brown, ch. 9; MML §3.8.1). Projecting onto the span of several vectors (the columns of ) is the idea behind least squares in module 2.2. The derivation below is the one to own (MML §3.8.2).
Why care? Every layer of a neural network is a matrix followed by a simple nonlinearity (UDL §4.4), and attention (4.4) is built from dot products and weighted sums of columns (UDL §12.2).
3. Explore
Section titled “3. Explore”Try these: make the determinant 0, then negative. Find a matrix with no dashed lines (a rotation). Set the columns to (2, 1) and (1, 2), then drag v onto a dashed line.
A = np.array([[2.0, 1.0], [1.0, 2.0]]) B = np.array([[0.0, -1.0], [1.0, 0.0]]) # rotate 90° print(A @ B) print(B @ A) # order matters np.linalg.det(A @ B), np.linalg.det(A) * np.linalg.det(B)
Tab indents · Esc then Tab leaves the editor · Shift+Enter runs
Implement matrix multiplication with loops, matrix-vector products as column combinations, rotations, the 2×2 determinant, and both projections. The tests compare against NumPy and check the geometry: residuals are orthogonal, and projecting twice changes nothing.
stubs/m1_1_linalg.pyLoading starter file…
Prefer your own editor? Edit exercises/stubs/m1_1_linalg.py and run mlc check 1.1. The tests are identical; import the results on the progress page.
Locally: mlc check 1.1.
5. Check
Section titled “5. Check”- not yet: All tests pass (0/?)
- not yet: Checkpoint quiz ≥ 80%
Learner log: time spent and points of confusion
Every confusion you note becomes a fix before the module is marked stable. Export it from the progress page and attach it to an issue.