Index Ai Academy
Foundation · Foundation mathCalculus

Review: find the slip (calculus)

About 36 minLooking ahead: some prerequisites aren't done yet

Why this matters

Calculus slips are quiet. A gradient step with a plus where a minus belongs still runs; it just climbs instead of descending. A chain rule missing its inner factor gives a slope that's off by a constant. A rate never divided by its step looks like a rate. Each gives a confident number, and the loss curve, or a careful check, is the only warning. This review gathers the module's commonest slips, each paired with the check that catches it, mixes problems from all of Module 5, and collects every rule on one sheet, ready for Module 6, where probability meets the losses these slopes are taken of.

  • Spot the common slips of Module 5: a step with the wrong sign, a chain missing its inner factor, a rate not divided by its step, a slope overwritten instead of added, and a learning rate that diverges; and two from optimizers and autograd
  • Find and fix slips in calculus code that runs but gives a wrong answer
  • Mix problems from every lesson of the module, and run a short calculus program in your head, line by line
  • Use the module's formula sheet: each rule, what it says, and its Python line; and see that Module 5 is a model's backward row
Quick check
Have a guess before you start. A training loop's loss goes 5, 7, 11, 19, 35, doubling its rise each step. Which slip is most likely?

Find the slip

Purpose. Five slips cover most of Module 5's mistakes, and each has a quick check:

  • The wrong sign. θ + η∇L climbs. Check: the loss must fall on the first small step.
  • A missing inner factor. ((3x + 1)²)′ is 2u × 3, not 2u. Check: compare with a central difference.
  • A rate not divided by its step. np.diff(v) alone is a rate only when the step is 1. Check: the units.
  • A slope overwritten. A value feeding two steps needs both contributions added. Check: a gradient check.
  • A diverging learning rate. Past 2 ÷ L″, steps overshoot and grow. Check: the loss must not rise.

Below are twelve worked lines, with a comment saying what each should give. Seven have a slip: the five above, and one each from lesson 80 and lesson 82.