Optimization stopped because the objective function cannot be decreased in the current search direction.
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 4 de En. de 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 ?
Respuestas (2)
Walter Roberson
el 4 de En. de 2023
1 voto
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.
1 comentario
KF
el 5 de En. de 2023
Matt J
el 5 de En. de 2023
1 voto
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 comentarios
Matt J
el 5 de En. de 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
el 5 de En. de 2023
Categorías
Más información sobre Optimization Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!