liveBook · Manning

Epoch

As explained in Local Image Generation

An epoch is one complete pass through a machine-learning training dataset during parameter optimization.

An epoch is one complete trip through every training image. It is the training-run dial that answers: “How many times should the model study this pile before it starts getting weird?” In a Stable Diffusion 1.5 fine-tune, 100 epochs provides room to watch the model evolve, but more epochs also take longer and can overtrain it. section 15.3.5

Treat epochs as checkpoints on a road trip, not a finish line:

  • Save checkpoints and generate samples at a regular epoch interval, such as every 10 epochs, so you can compare versions instead of trusting the final one automatically. section 15.3.7
  • Use an earlier checkpoint when its images look better; continued training can make a model less useful even when it has seen the data more times. section 15.3.5 section 15.3.7
  • Keep local batch size separate from epoch count: batch size controls how many images enter at once and depends on available VRAM. section 15.3.5

Watching a sandworm learn

At 10 epochs, a sandworm prompt begins producing a strange creature. By 30 epochs, the subject is clearer; through 90 epochs it keeps refining. At 100 epochs, two sandworms appear instead of one—a useful warning that more training is not automatically better. section 15.5.1

Early samples can matter more than neat-looking numbers. A space man becomes recognizable after 10 epochs, while a cowboy’s distorted face improves sharply by 20–30 epochs. Inspecting images as training proceeds helps identify when the model starts looking right. section 15.5.2 section 15.6

Figure 15.20 Thankfully we can teach Stable Diffusion what a sandworm is!

Compare sandworm samples across training stages to see why epoch-by-epoch sampling is more useful than blindly waiting for the last checkpoint. section 15.5.1

How Local Image Generation covers it

How deep it goes
Defines an epoch as one pass over training images and traces visible results through 100 epochs.
Examples
Compares sandworm, rhino, space man, and cowboy generations at successive epochs.
What it assumes
Teaches epochs from zero while assuming access to a configured Stable Diffusion 1.5 fine-tuning run.
What you can do after
Evaluate/understand checkpoint samples to select an earlier model when later training overtrains.
How it connects
Connects epochs to checkpoints, sampling, local batch size, VRAM, and overtraining.

Also explained in

Compare how 14 books explain epoch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Local Image Generation. The section links point to the parts of the book it draws on.