Skip to content

Glossary: Deep Learning Basics

model.train() / model.eval()

Also written: model.train(), model.eval(), train mode, training mode, eval mode, evaluation mode

`model.train()` makes dropout active and batch norm use batch statistics; `model.eval()` switches them to prediction behavior. Call train before training batches, and eval together with `torch.no_grad()` before measuring or predicting.

Where the book teaches it

Related terms

DropoutBatch normalizationtorch.no_grad