Open anders34 opened 8 years ago
Gradient descent algorithms usually have checks in place for cases where there is no global minima/maxima (limit max number of gradient descent steps, have a check on the derivative value etc). For the purposes of this assignment, since you have been asked to implement a very simple version of the algorithm we would not be testing it with such functions (although the case of a flat horizontal line with df=0 should still work with your algorithm, it should return with no change to the initial guess). For the purposes of this assignment, as long as your algorithm can find a global minimum of simple trigonometric and well-scaled polynomial functions with a global minimum, it'll pass the tests.
What is gradient descent supposed to do when the function is a line, either a flat line or one with a slope greater than or less than zero?