Week 1 Optional Lab: Gradient descent, not getting the same number of iterations running gradient descent in Jupyter Notebook

Hi guys,

I’m running the code for the optional lab in Jupyter Notebook. However, when running the gradient descent it doesn’t run for 10000 iterations, but it only gives me iteration 0. Does anyone have an idea what might be going wrong?

image|690x311

Thanks

I think you might have accidentally indented the “return” line in the training code snippet.

The line return w, b, J_history, p_history should only have 4 spaces (1 indent) instead of 8 spaces (2 indents) in front of it.

1 Like

That was exactly what I did…
Thank you very much for pointing that out, it works now.
I think it goes without saying with this mistake how new I’m to this.

I appreciate you a lot for helping.