with gzip.open(path/‘mnist.pkl.gz’, ‘rb’) as f:
((x_train, y_train), (x_valid, y_valid), _) = pickle.load(f, encoding=‘latin-1’)
In Lesson 5 during the MNIST exercise, we throw away the test set. Why don’t we need the test set here? In what cases would we need both the validation and the test set?
Training set and Validation set is always required. Because based on the training set the neural network learn and based on the validation set your model is validated and calculated your loss function and metrics (like accuracy). And the test set is only used to validate your final solution. A Test set is not used in the learning process. Below you find some info.
For me, just show that you can. It have nothing to do with the rest of the code. By this, you can predict values learn.pred_batch(DatasetType.Test) to upload for example to your Kaggle competition and get some results.