What is ids[j]?

in implementing gradient descent what is ids[]?

Hi @dakshtrehan,

Here we are implementing mini-batch gradient descent, that has some variation from the gradient descent.
Suppose we have 1000 examples, instead of loading all the examples at the same time, mini batch gradient descent uses first 32 or 64 examples, perform gradient descent with those, release them and pick the next 32/64 examples, with this it saves a lot of memory when the dataset becomes huge

So here, ids are the numbers from 0-31 for the first time, and we shuffle these ids. so that we will be taking first 32 examples in a random fashion. After the first batch, ids will contain numbers from 32-63.

i = ids[j] this line basically tells which elements we want to consider, since the elements in ids are random, every time i will have random element from the first 0-31 elements.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.