Bitpath

Lesson 1 · Unit 04

Debugging models

Find the bug when nothing crashes and nothing learns

13 exercisesabout 3 min

What you practise

  • Shape mismatches, dtype and device errors, NaN losses, loss that won't fall (learning rate, missing zero_grad, wrong loss input), overfitting one batch as a test

Try a question from this lesson

Pick one

A 10-class classifier trains with no errors, but the loss reads 2.30 at the first step and 2.30 at the last. What is that number telling you?

Hint

A model that knows nothing spreads its belief evenly over the classes. What does cross-entropy give then?

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

A ladder for silent bugs

When a model runs but will not learn, climb in this order. Each rung is cheap, and most bugs live on the first two.

The third rung is the big one: a correct model, loss and loop can memorise a handful of samples and drive the loss to nearly zero. If yours cannot, the pipeline is broken.

1  print the shapes of x, pred and y
2  check dtypes and devices
3  overfit one tiny batch
4  only then tune the learning rate

11 more exercises in the app

  • 5× multiple choice
  • 1× fill the blanks
  • 1× true or false
  • 1× order the lines
  • 1× match the pairs
  • 2× type the answer

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy