3/32
Part 1 of 6 · The chain ruleLearn and do
The chain rule, one step at a time
Each step multiplies the gradient from above by its own slope
Start smaller: three numbers and two steps.
a, b, c = 2.0, -3.0, 10.0
e = a * b
L = e + c
dL = 1.0 # start at the loss
# an add passes the gradient through
de = dL
dc = dL
# a multiply sends each input the other input
da = de * b
db = de * a
print(L, da, db, dc)
a = 2, b = -3, c = 10, then e = a * b and L = e + c. What are da, db and dc?
Pick one to see what it prints.
Pick an answer above to see the rest