An epoch is one complete pass through every example in a training dataset, so each sample is seen once. Training often repeats this pass because optimization may need more information than the available examples provide. section 2.5
Multiple epochs improve access to limited training data but increase ingestion cost. If one Fashion-MNIST epoch takes three hours, two sequential epochs take six hours, making repeated reads and preprocessing operational concerns. section 2.5.1 section 7.2.1
A caching pattern reduces the cost of later epochs when resources permit:
- Read and train on batches during the first epoch while appending consumed batches to an in-memory cache. section 2.5.2
- Feed cached batches directly to the model during subsequent epochs instead of repeatedly reading from the original data source. section 2.5.2 section 7.2.2
- Cache preprocessed batches when transformations are expensive, avoiding repeated preprocessing before model training. section 2.5.2
Fashion-MNIST with cached batches
During the first epoch, process Fashion-MNIST batches and retain them in memory. During the second and later epochs, train from those cached batches rather than reading the dataset again. section 2.5 section 2.5.2
Figure 2.17 A diagram of model training for multiple epochs at time t0, t1, and so on, using a cache instead of reading from the data source again
Visualizes the transition from reading the data source during the first epoch to reusing cached batches in later epochs. section 2.5.2









