The batching pattern divides a dataset into smaller batches so a machine-learning system can ingest and process data without loading the entire dataset into memory. section 2.0 section 2.10
A typical workflow is:
- Divide the dataset into subsets or mini-batches small enough to load into memory. section 7.2.2
- Load one batch, perform expensive mathematical operations, and use the result for a model-training iteration. section 7.2.2
- Consume batches sequentially, repeating the process until the dataset has been processed. section 2.4
Batching reduces out-of-memory risk and allows larger datasets to be processed by reducing mini-batch size. It still depends on storing and partitioning the full dataset, so extremely large datasets may require sharding across machines. section 2.4 section 7.2.2
Expanded Fashion-MNIST
A decompressed 50-GB dataset can be divided into ten 5-GB batches and consumed sequentially for model training. A smaller example divides 1,000 records into batches of 500. section 2.4 section 7.2.2
Figure 7.6 The dataset is divided into two batches and processed sequentially. The first batch is consumed to train the model at time t0, and the second batch is consumed at time t1.
Shows a dataset divided into two batches and processed sequentially during model training. section 7.2.2
