Skip to content
Discussion options

You must be logged in to vote

Hi @bhandari-nitin ,

In this case, we test the model every epoch.

As in, do a forward pass on all the training data, calculate the loss and then progress the optimizer (steps 1-5).

After those steps are done, we turn the model into eval() mode with model.eval() and then perform a forward pass on the test data and calculate the loss.

Although these steps are in the same for loop, the test calculations do not interfere with the training calculations.

You can test the model outside the training loop (e.g. only test every 5 epochs) by creating a specific function to test the model.

However, in this case, we've decided to do training & testing in one loop.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Giubb8
Comment options

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