Skip to content
BENIBIX Learn

Epoch vs Batch Size

People often think an epoch is one training step. It is a full pass over all the data. Batch size is how many examples go into one step. So with 1,000 examples and a batch size of 100, one epoch takes 10 steps.

AI📈 Machine Learning

Epoch

One full pass through all the training data. Training runs many of them.

An epoch is one full pass through all of the training data. If you have 10,000 examples, one epoch is done when the model has seen all 10,000 once. Training usually runs for many epochs, so the model sees each example many times. Each pass, it learns a little more. With too many epochs, it starts to memorise the data.

Example
Jack has 50,000 photos and trains for 10 epochs. His model sees every photo 10 times, which is 500,000 looks in total.
Why it matters
The number of epochs is a key setting. Too few, and the model has not learned enough. Too many, and it memorises.
Full entry
AI📈 Machine Learning

Batch Size

How many examples the model reads before each update. Often 32 or 64.

Batch size is how many examples a model looks at before it updates its weights. Training does not use all the data at once. It splits the data into small groups called batches, often 32 or 64 examples each. After each batch, the weights take one step. Bigger batches use more memory, and smaller ones give noisier steps.

Example
Lucy has 1,000 examples and a batch size of 100. Each epoch has 10 batches, so the weights get 10 updates per pass.
Why it matters
It changes how fast training runs and how much memory it needs. A batch too big for the chip will not run at all.
Full entry

In one line

Epoch
One full pass through all the training data. Training runs many of them.
Batch Size
How many examples the model reads before each update. Often 32 or 64.