Optimization stopped because the objective function cannot be decreased in the current search direction.
Show older comments
Error message "Optimization stopped because the objective function cannot be decreased in the current search direction. Either the predicted change in the objective function, or the line search interval is less than eps."
when using fminunc to minimize a multidimension function.
The cost function is "almost smooth" with very small quantization artifact <1e-8. These small bumps are insignificant to the problem itself. Is there any method that can avoid being trapped in these "local minimums" by setting "optimization step size"? Or reduced the resolution when evaluating its gradient?
I found a few options 'DiffMaxChange' 'DiffMinChange' and 'FiniteDifferenceStepSize' potentially related, but not quite clear how they may be used.
2 Comments
Walter Roberson
on 4 Jan 2023
When you say that the cost function is "almost smooth", do you mean cost(x) is, in places, locally constant to within +/- 1e-8 ? Or do you mean that cost(x) is linear to within +/- 1e-8 ? Or do you mean that cost(x) in theory has non-zero continuous second derivative that would be indefinitely smooth in theory but in practice there are matrices with high condition number involved and the error adds up to about +/- 1e-8 ?
Answers (2)
Walter Roberson
on 4 Jan 2023
1 vote
Is there any method that can avoid being trapped in these "local minimums" by setting "optimization step size"? Or reduced the resolution when evaluating its gradient?
No. Such functions are not suitable for minimization with any minimizer that works with gradients or hessians.
You would need to use ga() or a couple of the other minimizers.
Matt J
on 5 Jan 2023
1 vote
I found a few options 'DiffMaxChange' 'DiffMinChange' and 'FiniteDifferenceStepSize' potentially related, but not quite clear how they may be used.
You can try setting DiffMinChange to be greater than 1e-8, but I think it would be better to remove the quantization operations from your objective function. Make sure any interpolation operations you are doing use cubic interpolation, for example, instead of nearest-neighbor.
3 Comments
Matt J
on 5 Jan 2023
Unfortunately, I cannot find any documentation on the relationship between 'DiffMinChange' and 'FiniteDifferenceStepSize', but I am assuming that step size is given by,
step = max(DiffMinChange, FiniteDifferenceStepSize)
That's the only thing that would make sense to me, at least.
KF
on 5 Jan 2023
Categories
Find more on Optimization Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!