Giving target function outputs to optimization algorithm

조회 수: 11 (최근 30일)
Nathan Bblanc
Nathan Bblanc 2024년 1월 25일
댓글: Nathan Bblanc 2024년 1월 30일
I have a multivariable function that I am trying to optimize the output of. The function is time-consuming so I am using surrogate optimization (through the global optimization toolbox). However, during the run of the function at a specific point, I am also obtaining knowledge of the function values at various additional points. (This is because I am using a continuation method when running the function, but that doesn'tmatter too much). This means that after a few times the optimization algorithm calls the function, I already have dozens of known function output values. My question is- Is there a way to inform the algorithm about these values? Either through the optimization options or through the code of the optimization code itself?
So far what I did is tabluate the obtained values, so that If the optimization algorithm calls the function with a value very near one of them, I can return the obtained value instead of running the function. However this is kind of a workaround and not an actual solution.
Would be thankfull for any assistance

답변 (1개)

Alan Weiss
Alan Weiss 2024년 1월 25일
While I haven't tried this before, it sounds to me as if you could change your objective function to use a data set of known points and objective function values, and the set of known points and values can grow over time. I'm not sure how you would best make use of this extra information, but that is something else.
For example, suppose M is the auxiliary matrix of known points, where each known point is one row in M. Suppose N is the vector of associated objective function values, so N(i) is the objective function value of row i of M. Maybe the easiest way to do things is to have M and N be persistent variables. Write the objective function like this:
function fval = myfun(x)
persistent M N
% Perform your computation here. You might want to check whether M and N
% are empty or not before using them.
%
% When you find a new point, say p with objective function value f, include
% them in the matrices:
M = [M;p(:)']; % ensure that p is in row form when appending
N = [N;f];
end
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 5
Alan Weiss
Alan Weiss 2024년 1월 29일
Oh, sorry for misunderstanding your request. Now I understand that you want to change the surrogateopt algorithm to accept extra data points and values in the middle of a run. That is indeed what you said in your original post, but I didn't understand it until now.
I don't know of any way of doing what you ask. I suppose that you could record the points and associated values, have a relatively short MaxFunctionEvaluations limit, and repeatedly restart surrogateopt with those points and values given in the InitialPoints option. But I doubt that this would really improve your optimization. So the short answer is no, I don't know of a way that would help.
Alan Weiss
MATLAB mathematical toolbox documentation
Nathan Bblanc
Nathan Bblanc 2024년 1월 30일
OK, thanks Alan. Maybe someone else might have a different answer.
Nathan

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by