eval() changes the Module to evaluation, i.e. some layers like Dropout and BatchNorm change their behavior. In the case of Dropout, the connections won’t be dropped but scaled.


The curves show the predictions on the test data. As you can see, the “overfitted” model predicts the samples closer to the training data as it’s overfitting.
Generally both your data sets, train and test, are sampled using the same function, so you will see your model is overfitting if the predictions get very close to the actual training data and fail to generalize the underlying function.