Help with Matlab Optimizer

1 ビュー (過去 30 日間)
Cole
Cole 2014 年 10 月 16 日
編集済み: Matt J 2014 年 10 月 16 日
Hi,
I'm having a lot of trouble with the Matlab optimizer. Right now, I'm just trying to get the solver working by optimizing on one variable then I will move on to the full optimization problem using all variables.
I keep getting an error saying "my initial point is a local minimum". I know this isn't the case because I've done some manual optimization and I've on purposely set the starting point to be away from the minimum.
It also says "Optimization completed because the size of the gradient at the initial point is less than the selected value of the function tolerance". I'm not sure what this means exactly. I've tried setting 'TolFun' in the options to larger values and I still get the same error.
This is my code so far:
x0 = 10
f = @(x)optimfun(input1, input2, input3, x);
options = optimoptions(@fminunc,'Algorithm','quasi-newton','TolFun',0.01);
[x,fval,exitflag,output] = fminunc(f,x0,options);
optimfun is a custom function that I build that calls a series of subroutines to process images.
I've tried different values for x0 (note: x0 is a continuous variable) and different values for TolFun right from 1e-6 to 10. I get the same error regardless.
From my manual optimization, I know that different values of x gives the following results
x = 9; fval = 0.612
x = 9.5; fval = 0.602
x = 10; fval = 0.6140
x = 10.5; fval = 0.623
I know the real minimum point should be somewhere around 9.5 but no matter what I set x0 to be, it is always the "optimal point" according to the solver.
I'm really confused and some help with this would be great.
Thanks
  1 件のコメント
Matt J
Matt J 2014 年 10 月 16 日
編集済み: Matt J 2014 年 10 月 16 日
Please don't duplicate your posts. Your question is essentially the same as the one you asked here, and to which I responded
The best theory, without seeing your code, is still, I think, that your function contains quantization operations that make it piecewise constant. See also this recent related thread, where I provide some illustration of this,
However, the bottom line is (still) that we have to see your objective function optimfun to know what's going on.

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by