In the previous sections, for all the models that we have built, we considered a batch size of 32. In this section, we will try to understand the impact of varying the batch size on accuracy.
Impact of batch size on model accuracy
Getting ready
To understand the reason batch size has an impact on model accuracy, let's contrast two scenarios where the total dataset size is 60,000:
- Batch size is 30,000
- Batch size is 32
When the batch size is large, the number of times of weight update per epoch is small, when compared to the scenario when the batch size is small.
The reason for a high number of weight updates per epoch when the batch size is small is that less data points are considered to calculate the loss value. This...