Why the batches where formed in the implementation?

Why did we used the following code:

ids = np.arange(no_of_samples) and np.random.shuffle(ids)

What is the purpose of forming batches?

Hey @HemantKumar, the first line of code will have ids = [ 0 1 2 … no_of_samples-1 ] , and np. random shuffle will shuffle them, ids will contain these numbers only but in shuffled manner. Now we will pick training examples in this order to form batches.

Purpose of forming batches, slowly and steadily when you proceed with the course you will understand that real word problems have a very very huge dataset, which we are unable to load and keep in memory for all the time, so we prefer loading a small batch and than training, than loading and training and this cycle keeps on repeating, This goes on and on. And hence we are able to train our model on whole dataset, even though it is quite large.

Hope this cleared your doubt. Plz mark the doubt as resolved in my doubts section. :blush: