Issue with large memory required for non-linear optimizer
古いコメントを表示
Dear Matlab community hi.
I tried to run the following optimization problem for a 2-dimensional optimization variable of size 150x150. For some reason, the system creates somehow in the optimization process (I guess) some matrix of size (150^2)x(150^2). I tried to solve the issue for several days now (with the different options shown in comments) but I cannot understand why MATLAB creates such a huge matrix in the solution process. Is there, perhaps, some other nonlinear optimizer in MATLAB that does not require such huge matrices? Any help on this issue would be very helpful.
With best wishes,
Yannis
a = 4;
b = 2.1;
c = 4;
x = optimvar('x',150,150);
prob = optimproblem;
prob.Objective = parameterfun(x,a,b,c);
%opts=optimoptions('fmincon','Algorithm','interior-point','SpecifyObjectiveGradient',true,'HessianFcn','objective');
%opts=optimoptions('quadprog','Algorithm','trust-region-reflective','Display','off');
opts = optimoptions('fminunc','Algorithm','trust-region');
opts.HessianApproximation = 'lbfgs';
opts.SpecifyObjectiveGradient = false;
x0.x = 0.5 * ones([150,150]);
%[sol,qfval,qexitflag,qoutput] = solve(prob,x0,'options',opts);
[sol,fval] = solve(prob,x0)
3 件のコメント
Torsten
2023 年 4 月 19 日
Try a simple gradient descend method.
All MATLAB optimizers seem to use 2nd order information of the function to be minimized. This means the Hessian must be built/approximated which has dimension n^2 if you have n variables to be optimized.
Correct me if I'm wrong.
Yannis Stamatiou
2023 年 4 月 20 日
移動済み: John D'Errico
2023 年 4 月 20 日
Torsten
2023 年 4 月 20 日
移動済み: John D'Errico
2023 年 4 月 20 日
And what did you decide to do ?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Solver Outputs and Iterative Display についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!