And for anyone who wants to know why unmodified gradient descent may be considered a piece of shit in certain circumstances
http://wikipedia.org/wiki/Rosenbrock_function
Gradient descent with a good line search (Wolfe conditions) applies to the multidimensional case should converge to min, but it might take you thousands of iterations. Newton’s method or something might take <50.
But machine learning practitioners will know why gradient algorithms are often preferred despite this