LESSON 6.03 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Autograd
Watch autograd record a graph, then send gradients back through it.
Needs6.02 Broadcasting
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 6.03 · AUTOGRAD BAYL = 3.17 · 5 GRAD_FN NODES
01
Stage 1 of 6 · Record the graph
Each operation in the forward pass records a grad_fn node, named above its box. The dashed slots wait for gradients.
Explain it simply
You see the forward pass run from left to right. Each result keeps a backward node, named above its box, that knows how to send a gradient back. W and B ask for gradients, and X does not. The dashed slots under each value wait for the gradients.
A graph from left to right. Leaves x, w and b feed MulBackward0, SumBackward0, AddBackward0, MyTanhBackward and MseLossBackward0. The loss L is 3.17. Only w and b ask for a gradient.
input x, target t, node valuesw, b and your own code (Function, hook)loss and gradientsoutput ygrad_fn nodesno gradient
Toy: 3 weights, a bias, 2 hand-picked examples · float64
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The loss compares f of the weighted sum with the target t.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 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.