internalsGet Pro

Module 06 · Lesson 2 of 9Pro

Loss functions: measuring how wrong a model is

Level
Beginner
Topic
How models learn: losses and training
Reading time
13 min

When you finish this page you can

  1. Compute a model’s loss on a small dataset by hand, from one miss per example to one average.
  2. Explain why training needs a single number that changes smoothly with every parameter, and why a count of mistakes fails that test.
  3. Tell the loss a model is trained on apart from the business cost it is judged by, and spot when the two disagree.
  4. Choose how to train and how to pick a model when the cost you care about can’t be optimized directly.

Builds on 3 lessons

Start with lesson 112 min
  1. Models as functions with learnable parameters12 min
  2. Gradient descent: walking downhill to a better model14 min
  3. Maximum likelihood: fitting models to data17 min

Two settings, the same two mistakes

is our example online store. Every Monday, Joseph’s growth team sends ₹100 vouchers to the 20,000 customers most likely to : to stop buying. Farah, an ML engineer, builds the model that ranks them, on a 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