internalsGet Pro

Module 06 · Lesson 3 of 9Pro

Common losses: squared error to cross-entropy

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

When you finish this page you can

  1. Say which number each loss makes a model predict, the mean, the median or something between, and pick the one the decision needs.
  2. Explain how hard one example pulls on training under squared, absolute and Huber loss, and set Huber’s δ in the target’s units.
  3. Explain why yes-or-no labels train with log loss rather than squared error, and pass raw scores to PyTorch’s cross-entropy losses.
  4. Use label smoothing knowing what it does to the loss floor and to the model’s chances.

Builds on 3 lessons

Start with lesson 213 min
  1. Loss functions: measuring how wrong a model is13 min
  2. Expected value, variance and spread13 min
  3. Entropy and cross-entropy: measuring surprise17 min

Five customers, one prediction

is our example online store. Farah, an ML engineer, is building a model for Joseph’s growth team. It predicts how much each customer will spend next month, so Joseph can size the monthly voucher budget.

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