liveBook · Manning

Epoch

As explained in Distributed Machine Learning Patterns

An epoch is one complete pass through every training example in a dataset during model training.

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
02-17

Visualizes the transition from reading the data source during the first epoch to reusing cached batches in later epochs. section 2.5.2

How Distributed Machine Learning Patterns covers it

How deep it goes
Defines a complete dataset pass, quantifies sequential cost, and explains batch caching without descending into optimizer internals.
Examples
Uses Fashion-MNIST, 60,000 examples, three-hour epochs, sequential batches, and in-memory cached or preprocessed batches.
What it assumes
Assumes a training dataset and model-training process, while defining epochs and batch-based reuse from the beginning.
What you can do after
Apply it via a caching pattern to reduce repeated dataset reads and preprocessing across training epochs.
How it connects
Connects epochs to batch gradient descent, datasets, preprocessing, model training, and caching.

Also explained in

Compare how 10 books explain epoch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.