internalsGet Pro

Module 09 · Lesson 9 of 11Pro

Debugging a network that won’t train

Level
Intermediate
Topic
Neural networks
Reading time
17 min

When you finish this page you can

  1. Predict the loss a classifier should show before its first step, and read what a different value means.
  2. Use the overfit-one-batch test to tell a bug in the model and training loop from a bug in the data.
  3. Recognize six silent bugs by their signature in the starting loss, the gradient sizes and the validation accuracy.
  4. Find where a NaN first appears, and guard a long run against one.

Builds on 4 lessons

Start with lesson 414 min
  1. Building a neural network in PyTorch14 min
  2. Weight initialization and unstable gradients16 min
  3. Batch and layer normalization16 min
  4. The training loop: predict, measure, adjust13 min

Five epochs, no error, 10% accuracy

is our example online store. Sellers pick each product’s category themselves, and Farah, an ML engineer, is building a model that suggests the category from the product photo. Joseph’s growth team wants it so miscategorized products show up in the right “similar items” row.

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