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()