Skip to content
BIASED

Model compression

Block 1 of 7~2 min

Why compress

Adversarial examples made a network robust at the price of more training. At deployment the network meets a different budget. A phone shares a few gigabytes and a battery; a server pays for every multiply-add; a car needs an answer in milliseconds. A network trained for accuracy is usually larger than the function it computes requires.

Inference costs three things: memory for NN parameters (plus activations), compute (about one MAC per weight per input for a dense layer), and time and energy to move data and do arithmetic. Those three are not proportional. Fetching a number from off-chip DRAM dwarfs computing with it — 640640 pJ to read 3232 bits versus a few pJ for an fp32 MAC on a 4545 nm process. At batch size 11 a layer is usually memory-bound. Fewer and smaller weights help twice.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • Magnitude pruning: density and erroroptional

    Zero out 90% of weights by |w|; density, Frobenius error, renormalization. Self-check in the notebook.

    ~15 min · easier on a computer · Model compression topic read.

    Self-check in the notebook — not part of mastery or the certificate.