Solved by braindotai in post #7 
              
              
                Okay, now I understand your doubt. 
See in first case you are predicting, calculating loss, calculating gradients, and applying gradient update for each batch, so total number of these operations happening for each epoch is equal to  “number_of_batches”, which can be calculated as (len(X)//batch_siz…