Confused about Mini-Batch Gradient Descent

Hey guys, So lately, it starts to be even confusing. Prof. Ng, has tell that when we plot the cost function in mini batch GD, it would be noisy but it will trends down. My question is that on every iteration, does it compute J{t}? For example 1st iteration is computing J{1}, 2nd iteration is computing J{2}. Please do let me know if this is correct. Thanks.

Cost is computed for every mini-batch. If it helps, see compute_cost inside model method in week 2 assignment 1.

Hey, i haven’t do the quiz yet neither the assignment and neither finished all the lectures. I’m confused while listening to the lecture.

Got it.
A simple way to remember is to compute cost for the current data points before updating thetas. The batch size doesn’t matter.