Member-only story
What you need to know about batch sizes for your neural network
The number of examples to train a neural network is an essential way to influence the training process.
In machine learning jargon, we call this the “batch size.” A batch is nothing else than a group of examples packed together in an array-like structure.
Let’s talk about how things work.
First, a little bit of context
We can’t talk shop without focusing for a quick second on how the training process works. Here is a rough summary that should be enough for our purposes:
- We take a batch of examples from the training dataset.
- We run that batch through the model to compute a result.
- We find how far away that result is from where it needs to be.
- We adjust the model’s parameters by a specific amount.
- We repeat the process for as many iterations as required.
The number of examples we are using to create that batch is the first decision we are making. It’s a critical choice that will impact how the process works.
We have three possible options to pick from:
- We can use the entire training dataset to create one single, long-ass batch 🙈.