A neural network is trained on 2000 labelled examples with a batch size of 50. What are an epoch, a batch and an iteration, and how many iterations make up one epoch?
Deep learning, Training and regularisation
Level L1 Beginner. Length One-liner. Nature Th+Mat Both.
What's being asked
Whether you know the three words used in every training log and can connect them with one division.
Key idea
A batch is a small group of training examples used for one weight update. An iteration is one such update. An epoch is one full pass through all the training examples. So iterations per epoch .
Steps
- Define the words with a school example: 2000 exam papers marked in piles of 50. Each pile is a batch, marking one pile is an iteration, and marking all the papers once is an epoch.
- Divide: , so one epoch has 40 iterations.
- Say why we use batches. Using the whole dataset for every update is slow; a batch gives a good enough estimate of the direction to move the weights.
Common mistakes
- Mixing up epoch and iteration. An epoch covers all the data; an iteration covers one batch.
- Forgetting the weights change after every iteration, not only at the end of an epoch.
How long your answer should be
2 sentences.
Read this
Previous in Deep learning: What is backpropagation in a neural network, and what roles do the forward pass and the backward pass play during training?
Next in Deep learning: What is dropout in a neural network, why does randomly switching off neurons during training reduce overfitting, and what happens at test time?