Question on C2_W2_Lab_2

I was working through second lab in week 2 of course 2 and did not think the function “gradient_descent” defined correctly. Here we have dfdx(x,y) for the calculation of new x and new y. If we use the current formulas, doesn’t that mean the new x will go to the new y calculation, instead of old x? Should dydx(x,y) be calculated first using old (x,y) and then this value will go into new (x,y) calculation?

Hi @EagleEdge!

Very well spotted! Thanks for noticing this. Indeed, it should have an intermediate step to prevent modifying the x when passing to y. It wouldn’t change the convergence to the local minimum, though, but it is not how it is supposed to be.

I will inform our Curriculum Engineer to fix it.

Thanks,
Lucas