Log inStart free
LESSON 36.C1 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Compressing one model four ways

One small net shrinks four ways, and each result lands on one accuracy-vs-size chart.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 36.C1 · COMPRESSION BAYTEACHER · 99 PARAMETERS · 198 B · 94%
01
Stage 1 of 5 · The teacher
The teacher net has 80 weights and 19 biases. In FP16 it takes 198 B and gets 94% right.
Explain it simply

In the plane, each small mark is one test point, blue when the teacher guesses its class right. In the grid, each ochre square is one weight, sized by how big it is. A filled square is plus, a hollow one minus. All 99 numbers take 2 bytes each, so the net needs 198 bytes.

A plane of 169 test points, almost all blue, and a grid of 80 weight squares. Size bar: 198 bytes. Accuracy bar: 94 percent.

training pointsweights, scales, factorsright guesses, resultswrong guessestrue borders, teacher, zeros, old weights
−3−30033x₁x₂the teacherthe teacher's guesses on 169 test pointsThe teacher: 2-16-3, 99 parametersW1 · input → hidden unitW2 · hidden unit → classx₁x₂class 0class 1class 212345678910111213141516unitsize198 Bweights 160 + biases 38accuracy94%159 of 169 right · dashed: teacher 159−3−30033x₁x₂the teacherthe teacher's guesses on 169 test pointsThe teacher: 2-16-3, 99 parametersW1 · input → hidden unitW2 · hidden unit → classx₁x₂class 0class 1class 212345678910111213141516unitsize198 Bweights 160 + biases 38accuracy94%159 of 169 right · dashed: teacher 159
Toy: the 36.C1 teacher net, 2-16-3, on 72 points; accuracy on 169 test points
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
z=W2tanh⁡(W1x+b1)+b2\sy{z}{out}{z} = \sy{w}{param}{W_2}\tanh(\sy{w}{param}{W_1}\sy{x}{data}{x} + b_1) + b_2
99⋅2 B=198 B99 \cdot 2\,\text{B} = 198\,\text{B}

Two weight layers and one tanh turn a point into 3 class scores.

Common mix-ups

MYTHTwo nets of the same size are equally accurate.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Strong pruning also takes 88 B. Does it keep more or less accuracy than INT4's 90%?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.