if you have visited many codes in deep-learning writing by pytorch, you will notice that model.train() and model.eval()
BUT THE DIFFERENCE BETWEEN THEM DO YOU KNOW?
In many cases, the model.train() means that the model would be trained in the following codes. but in the pytorch docs which says that every tensor is trainable=true in default. Only some specific modules in pytorch will be affectd, for example, dropout, batch-normalization.
Dropout is a regularization method in deep learning, which will randomly select nerves and make them dead. But if you evaluate the performance of your model, then you need to change the state to model.eval().In the evaluate mode, all the connection will be fully connect.