Batch size is the number of samples fed into the network at once during the training of a deep learning model.
The model is usually updated by applying gradient descent during training, and batch size plays an important role in this process. Batch size is regarded as a factor that affects model performance, convergence speed and memory usage.
Performance improves when a large batch size (e.g., 256) is used with a large learning rate (e.g., 10^(-3)), and a small batch size (e.g., 16) is used with a small learning rate (e.g., 10^(-5)).
However, using a large batch size is not recommended.
In practice, it is recommended to start with a small batch size (e.g., 32, 64) and a small learning rate.
For GPU efficiency, the batch size should preferably be a power of two, 2^n.
Reference: The effect of batch size on the generalizability of the convolutional neural networks on a histopathology dataset (2020)

