Let's say that we have a three dimentional convex function with a minimum marked by a red dot. Can a full batch gradient in a blue point not directed to a red dot as drawn below?

Gradient descent example

Actually this question is about Andrew Ng's lection Gradient Descent With Momentum (C2W2L06). He said: "If you take one iteration of gradient descent either batch or mini-batch gradient descent maybe you end up heading [toward blue arrow]". Is it really possible for a full batch gradient?


Yes. Gradient descent heads towards the direction of steepest descent (or an approximation of it, in the case of SGD).

Recall that the direction of steepest descent is always perpendicular to the level curves (in this case the ellipses) of the loss function. So the blue arrow makes a lot of sense.

It is definitely not the case the gradient will always point directly towards/away from the minimum.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.