Clear Filters
Clear Filters

fmincon minimum number of iterations

64 views (last 30 days)
Are there any way to set minimum number of iterations in fmincon.
I don't want to stop algorithm when
options.OptimalityTolerance = 0,
options.ConstraintTolerance = 0, and
options.StepTolerance = 0.
I want fmincon to stop at the desired iterations for comparing with other algorithms.
  2 Comments
Ameer Hamza
Ameer Hamza on 5 Apr 2020
So you want the algorithm to run even after it finds the optimal value?
Shun Arahata
Shun Arahata on 5 Apr 2020
Yes. I am solving a nonconvex optimization problem.
I think fmincon stops when first order KKT condition is satisfied.
So fmincon might stop at a saddle point (not global optima value ).
However, I am comparing with another algorithm which converge to second order stationary points (i.e. algorithm does not stop at a strict saddle point).
What I want to see is given fixed iteration numbers then fmincon stops at saddle point however another algortihm does not stop at saddle point.
A good example is as follows. from https://arxiv.org/abs/1907.04450
PGD( projected gradient descent) can't escape from saddle point.
So there is no change in loss value of PGD.
On the other hand, SNAP( proposed algorithm in the paper ) can escape from saddle point.

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 5 Apr 2020
This shows how you can force fmincon to keep searching until a fixed number of iterations is reached. It uses a simple objective function, but fmincon still run to 1000 iterations.
opts = optimoptions('fmincon', ...
'OptimalityTolerance', 0, ...
'StepTolerance', 0, ...
'MaxFunctionEvaluations', inf,...
'MaxIterations', 1000);
[X,f,~,out] = fmincon(@(x) x.^2, 1, [], [], [], [], [], [], [], opts);
  2 Comments
Shun Arahata
Shun Arahata on 5 Apr 2020
This is exactly what I want to do. Thanks a lot.

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!