Write a sample python code for mini-batch generation.

Last updated on May 9, 2022, 12:34 a.m.

Generating Minibatches from the dataset is a very important step, as it helps to load data during training of Neural Networks for Mini-Batch gradient descent algorithm.

It’s possible to do so by using Tensorflow, Keras, and Pytorch. Over Here, we will just discuss how to write it in python using list, numpy arrays.

Method 1: Simple Approach


Method 2: With Shuffling