is there any command which uses gradient descent to find a minima ?

1 view (last 30 days)
I want to run gradient descent to find a minima for some differentiable function. Is there any command in matlab which does this ? is it available in optimization tool box?

Answers (1)

John D'Errico
John D'Errico on 14 Apr 2016
Edited: John D'Errico on 14 Apr 2016
Why do you think you need explicitly gradient descent? Steepest descent (i.e., directly following the gradient downhill) is often a terribly poor method for minimization in general.
Yes, there are several tools in MATLAB that do optimization. Everything from a Nelder-Mead tool (fminsearch) to more sophisticated tools in the optimization toolbox. It depends on what you have, i.e. constraints or not, and what type of objective function you have, linear or nonlinear. But there are no tools provided by The MathWorks that explicitly do steepest descent, as there are far better schemes available.
So, perhaps you are asking for a general tool that USES the gradient in a more intelligent manner than steepest descent, but just asked the question in a confusing way. Again, yes. Look in the optimization toolbox. You will probably want either fmincon or fminunc.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!