internalsGet Pro

Module 04 · Lesson 2 of 11Pro

The chain rule: derivatives through layers

Level
Beginner
Topic
Calculus and optimization for machine learning
Reading time
14 min

When you finish this page you can

  1. Find the derivative of a function inside a function by multiplying the rate of each step, each taken at its own input.
  2. Work out by hand how a churn model’s loss changes with its weight through a score, a sigmoid and a log loss.
  3. Explain how a network’s layers pass one slope back from the loss, and why many sigmoid layers shrink it.
  4. Check a chain-rule slope with a central difference and with autograd.

Builds on 2 lessons

Start with lesson 113 min
  1. Derivatives: how outputs change with inputs13 min
  2. PyTorch tensors: shapes, axes and operations14 min

The churn score has two steps

is our example online store. Every Monday, Joseph’s growth team sends vouchers to the customers most likely to : to stop buying. Farah, an ML engineer, is building the model that gives each customer that probability, on her notebook sample of 200,000 customers.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan