Using fast.ai to set up model training in a few minutes
In this section, we will use the fast.ai library (https://docs.fast.ai/) to train and evaluate a handwritten digit classification model in fewer than 10 lines of code, in the form of an exercise. We will also use fast.ai's interpretability
module to understand where the trained model is still failing to perform well. The full code for the exercise can be found at the following GitHub page: https://github.com/PacktPublishing/Mastering-PyTorch/blob/master/Chapter14/fast.ai.ipynb.
Setting up fast.ai and loading data
In this section, we will first import the fast.ai library, load the MNIST
dataset, and finally preprocess the dataset for model training. We'll proceed as follows:
- First, we will import fast.ai in the recommended way, as shown here:
import os from fast.ai.vision.all import *
Although
import *
is not the recommended way of importing libraries in Python, the fast.ai documentation suggests this format...