Where should I put net.train()?

If I train using k-fold, where should I put net.train()?
only once for each model?
in every fold?
or in every epoch?
does it give different performance?

Thank You

1 Like

From what I know train() enables some modules like dropout, and eval() does the opposit.

So I would say: before you start training your model call train() and then eval() when you are done. The classic workflow would be:

  • call train()
  • epoch of training on the training set
  • call eval()
  • evaluate your model on the validation set
  • repeat
6 Likes

I like this approach, thank you

Solve my problem! Thank you

How does this fit in with torch.no_grad()?

2 Likes