Linear Algebra

Layer 2 · Mechanics

Linear Algebra

The mechanics of matrix multiplication, shapes, and why order and dimensions matter so much in practice.

8 min read70 XP

  1. Input vector (d,)

  2. Weight matrix (d, k)

    learned parameters

  3. Matrix multiply

    row · column dot products

  4. Output vector (k,)

A linear layer, decomposed into the shapes that flow through it.

Matrix multiplication is defined so that entry is the dot product of row of and column of . This forces a shape rule: if is and is , the inner dimensions must match, and the result is .

Go deeper: L3 Code