Why does prediction needs batch size in Keras?

Keras can predict multiple values at the same time, like if you input a vector of 100 elements, Keras can compute one prediction for each element, giving 100 outputs. This computation can also be done in batches, defined by the batch_size.

This is just in case you cannot fit all the data in the CPU/GPU RAM at the same time and batch processing is needed.

Leave a Comment