Why does my optimization stop after the first iteration?
古いコメントを表示
I do not know much about numerical optimization. My question is, what are possible reasons for fmincon to stop after 0 iterations. Here are the clues:
- I do not provide a gradient or hessian.
- It stops because:"size of the current step is less thanthe default value of the step size tolerance and constraints are satisfied to within the default value of the constraint tolerance"
- feasibility is 0.0000,First-order optimality is 1.206e+09
- Using patternsearch works and it finds the optimum
Another question: I suspect, that patternsearch is much slower than fmincon when the number of arguments increases, right?
Thank you for your time.
3 件のコメント
jgg
2016 年 1 月 25 日
It stops because the default tolerances are met and the step size is small enough. You'll have to adjust these to get it to perform better.
A more fundamental point is that fmincon is a local optimizer; if you start near a locally flat point, it will just stop at the flat point. Patternsearch is a global optimizer and should perform better.
I'm not sure about the time comparisons between the two algorithms; I'd guess you're right, but it's probably not a huge difference when you don't provide a gradient to fmincon.
Rosi Marungu
2016 年 1 月 25 日
This should be a number as small as possible, right?
First order optimality isn't the only criterion that can trigger a stop. Also, to be considered small, a value for the first-order optimality measure need only be small relative to typical magnitudes of the function's derivative. Try this simple problem, for instance,
[x,fval,ef,out]=fmincon(@(x) 1e18*x^2,.5,[],[],[],[],0,1)
You will see that out.firstorderopt is ~1e9.
Bottom line -- we really need to see your code.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Surrogate Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!