Neuron 101

Math foundations / Chain rule

Türkçe

Plate8

Unit 1 · Topic 8 of 11

Chain rule

Medium, 6 min, 6 steps

xuy
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 6 Gears

Three meshing gears

Gear x turns u, and gear u turns y. u is a function of x, and y is a function of u.

Open in Colab
  1. def g(x):
  2. return 2.0 * x
  3. def f(u):
  4. return 1.5 * u
  5. x, h = 1.0, 1e-6
  6. u = g(x)
  7. du_dx = (g(x + h) - u) / h
  8. dy_du = (f(u + h) - f(u)) / h
  9. print(du_dx, dy_du, du_dx * dy_du)
a
2
b
1.50
ab
3