Mini-batch
A small group of objects (usually 32–512) used to compute the gradient and make one update of the parameters.
The Trade-off
| Approach | Objects per step | Character |
|---|---|---|
| Batch GD | the whole dataset | stable, but expensive |
| SGD | one | cheap, but noisy |
| Mini-batch | 32–512 | the golden mean |
Why It Is Convenient
- the gradient is stable enough;
- computation is fast, especially on a GPU — parallel across objects;
- little memory is required.
The size of the group is set by the batch size.