chapter ten
This chapter covers:
- Using
DataLoaders to load data fromDatasets with multiple child processes
- Implementing an introductory model that performs step 3, classification
- Setting up the basic skeleton for our training and testing application that loops per epoch, and feeds the model data from the training and testing
Datasets
- Timing long-running loops with a custom enumeration function
- Logging metrics that describe model performance and evaluating model performance using those metrics
We’re going to do two main things in this chapter. First, we’re going to take the Ct and LunaDataset classes we implemented last chapter, and use them to feed DataLoader instances, which will in turn feed our model with data via a training and testing loop. This model and loop will be the foundation that the rest of part 2 builds off of. Second, we’re going to use the output of that training loop to introduce the actual core challenge of part 2, which is how to get high quality results from messy, limited data. In later chapters we’ll be exploring the ways that our data is limited, as well as building mitigations for those limitations.
But before that, we must lay our foundation.
Figure 10.1. Training and testing loop, with an outer loop over each epoch.
The basic structure of what we’re going to implement will be: