Skip to content

What's the purpose of eval_model function? #1033

Answered by LuluW8071
SailSabnis asked this question in Q&A
Discussion options

You must be logged in to vote

In ur model architecture, u might use batch normalization, layer normalization, and dropout layers. Setting the model to evaluation mode turns off these layers and creates a separate environment for testing or prediction.

Similarly, during training, u use model.train() to activate all defined layers. If u look at ur training and testing loop code, model.train() and model.eval() will be constantly switching between these modes

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@SailSabnis
Comment options

@LuluW8071
Comment options

@SailSabnis
Comment options

Answer selected by mrdbourke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants