Why does changing the initial x0 values in an optimization with fmincon not change the result?
4 views (last 30 days)
Show older comments
I built a ptoblem of optimizing a function (a trained neural network) to maximize it through fmincon; after the first results I tried changing the initial values to x0 but the result does not change at all, neither if I do it by hand nor if I use multistart. why?
xx=x(:,100); an array of 12 element
x0=[0.25; 0.25; 0.25; 0.25];
pp=xx(1:8);
A=[];
b=[];
Aeq=[1,1,1,1];
beq=1;
lb=[0;0;0;0];
ub=[1;1;1;1];
myfunct=@(pe)-net([pe;pp]);
problem=createOptimProblem('fmincon','lb',lb,'ub',ub,'Aineq',A, 'bineq',b,'Aeq',Aeq,'beq',beq,'x0',x0,'objective',myfunct);
ms=MultiStart(StartPointsToRun="bounds-ineqs");
[xsol,fval]=run(ms,problem,10)
3 Comments
Matt J
on 17 Oct 2022
If so, then why do you doubt that fmincon is returning the proper global maximum?
Answers (0)
See Also
Categories
Find more on Nonlinear Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!