internalsGet Pro

Module 04 · Lesson 3 of 11Pro

Gradients: derivatives with many inputs

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

When you finish this page you can

  1. Find a partial derivative by holding every other weight fixed, and collect the partial derivatives into a gradient.
  2. Read the gradient as the uphill direction, its length as the steepness, and its dot product with any direction as the rate of change that way.
  3. Derive the gradient of a mean-squared-error loss in vector form: 2/n · Xᵀ(Xw − y).
  4. Check a gradient formula against central differences and PyTorch autograd.
  1. Dot products: measuring how similar vectors are13 min
  2. Least squares: the best-fitting line17 min
  3. Derivatives: how outputs change with inputs13 min
  4. The chain rule: derivatives through layers14 min

Three weights and one loss

is our example online store. Its ML team predicts which customers will stop buying, so Joseph’s growth team can send them a voucher. In Least squares, Farah, an ML engineer, fitted Joseph’s old risk score in one call to lstsq.

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