0Pricing
Deep Learning Academy · Lesson

Train vs Eval Mode

Why model.train() and model.eval() differ.

A Model Has Two Faces

Your network behaves differently while learning than while being tested. PyTorch calls these two states train mode and eval mode. 🎭

Flip Into Train Mode

Before training you call model.train. This tells every layer to behave the way it should while the model is actively learning from data.

model.train()

All lessons in this course

  1. Forward Pass, Loss, Backward, Step
  2. Write a Minimal Training Loop
  3. Track Accuracy While You Train
  4. Train vs Eval Mode
← Back to Deep Learning Academy