Glossary term
Glossary term
Foundations
A small, randomly selected subset of a batch processed in one iteration. The batch size of a mini-batch is usually between 10 and 1,000 examples.
For example, suppose the entire training set (the full batch) consists of 1,000 examples. Further suppose that you set the batch size of each mini-batch to 20. Therefore, each iteration determines the loss on a random 20 of the 1,000 examples and then adjusts the weights and biases accordingly.
It is much more efficient to calculate the loss on a mini-batch than the loss on all the examples in the full batch.
See Linear regression: Hyperparameters in Machine Learning Crash Course for more information.
For example, suppose the entire training set (the full batch) consists of 1,000 examples. Further suppose that you set the batch size of each mini-batch to 20. Therefore, each iteration determines the loss on a random 20 of the 1,000 examples and then adjusts the weights and biases accordingly.
It is much more efficient to calculate the loss on a mini-batch than the loss on all the examples in the full batch.
See Linear regression: Hyperparameters in Machine Learning Crash Course for more information.
Created for this library
An ML team trains with mini-batches of 256 examples to balance gradient noise and GPU utilization on a single accelerator.
A computer vision team uses mini-batches of 32 images because larger batches exceed GPU memory on its target hardware.
An NLP team uses mini-batches with dynamic padding to keep memory use stable across batches of varying sentence lengths.
Definition source: Google for Developers Machine Learning Glossary | Creative Commons Attribution 4.0 License