Optimization Question... Strange Results
1 ビュー (過去 30 日間)
I asked a previous question which I've moved beyond because I figured out the first problem but I'm getting weird results. I'm working towards a complex optimization problem but I'm starting by breaking it down into simpler problems to begin with. To start, I'm just trying an unconstrained optimization problem on 1 single parameter.
I have a complex routine that measures fractures in drill core automatically and compares them to a manual set of measurements that I did myself. I'm optimizing the automatic routine based on 100 manually measured photos. Once I'm happy with the results, I'm going to use these parameters to automatically measure over 5,000 photos.
The output of my function is correlation between the two sets of measurements. In my current, simple example, I'm just changing one parameter and seeing how correlation changes.
I've input the different parameters manually and get the following results:
f = 2, 4, 6, 8, 10
f(x) = 0.4, 0.45, 0.5, 0.45, 0.4
There is clearly a peak at f = 6... that's the optimal result.
However, with the optimizer, no matter what starting point I try, it says that point is the optimal result.
I've formulated it as follows:
opt0 = 4;
options = optimoptions(@fminunc,'Algorithm','quasi-newton');
[opt,fval,exitflag,output] = fminunc(@objfun1,opt0,options);
If I use 4 as my starting location, I get 0.45 as my optimal result. If I try 6 as my starting point, I get 0.5 as my optimal result. It doesn't seem to iterate over any different values correctly.
I'm not sure what's going on.
I'm working towards a complex problem where I'm going to optimize 6 different parameters with a bunch of constraints and bounds but I would like to get this working first.