How are the starting points for surrogate optimization chosen?

6 views (last 30 days)
I have a question regarding the "starting points" or the random points chosen to construct the surrogate. Is it possible to access the function that determines how the surrogate selects its random points?
I am testing different algorithms in MATLAB for a global optimization problem, and I always perform 50 different trials of 100 iterations each. The surrogate algorithm consistently produces very similar starting points and performs exceptionally well with them. The documentation describes this process as a pseudorandom sequence (https://en.wikipedia.org/wiki/Low-discrepancy_sequence), but in my opinion, this does not explain the similarity of the points shown on the cost function graph, especially since no random seed is set.
The graph displays the mean, minimum, and maximum of the cost function for the surrogate algorithm with random starts (over the initial X condition in the options of the surrogate) called Surrogate RNG and the surrogate algorithm. It is interesting to note how close the minimum and maximum of the cost function of the surrogate are.
Is it possible to have more options for surrogate optimization (such as those available in https://github.com/Piiloblondie/MATSuMoTo)? Additionally, is it possible to access the function for determining the starting points so that I can try it with other algorithms?
What could be the reason for the starting points to be so close together even when no random seed is chosen?
For additional context, I use 8-13 different variables, all of which are doubles. I also use one linear constraint that can be implemented in the function.

Answers (2)

Mario Malic
Mario Malic on 19 Jun 2024
Hi Paul,
rng seed is set by default and changes every time MATLAB is started. So, within multiple runs of surrogateopt, random number generator is the same, therefore trial (random) values should be the same (I tried with one example, and it was true). So, differences probably come from running MATLAB at different times (you closed MATLAB instance and then opened it).
If you debugged, and stepped in surrogateopt, there is a line that calls rng function to be used to generate random points.
Therefore, if you want to have different trials between each run, you should change rng settings.
  1 Comment
Mario Malic
Mario Malic on 20 Jun 2024
Edited: Mario Malic on 20 Jun 2024
I read the answer, and will suggest some thoughts here.
  • What exactly is interesting about how min and max values of the objective (cost) function are close to each other? You expect them to reach the same minimum? Is that difference in the objective function of 0.5 e-4 significant for you?
  • If your initial random values are still similar, then check out MinSampleDistance property. Default is 1e-6. If your variable values are much higher, then, this might be cause random variables to be very similar.
  • You can affect the number of trial points that will be generated by MinSurrogatePoints
  • Also, you can provide the initial points with the InitialPoints property. I think these are provided as trial points for surrogate to be constructed from.
  • There are different plots available, surrogateoptplot could give you more insights

Sign in to comment.


Paul Westhauser
Paul Westhauser on 20 Jun 2024
Thank you for your Answer,
i tryed to impliment the Chance of rng setting but it didnt work. Mybe i did it the wrong way, i tryed it in 2 ways both with the same outcome as the Graph
%% Option 1 chancing it in the Testing funktion
for i=1:N
rng(randi(100000),"twister")
[errorstruct.surrogate.error(:,i),errorstruct.surrogate.data(:,i),errorstruct.surrogate.alldata(:,:,i)]=fun_Surrogate(anz,umschaltstellen,Costfunction,Sim,Startwerte);
end
%% Option 2 using the Problem Structure
Problem.objective=fun;
Problem.lb=lb;
Problem.ub=ub;
Problem.solver='surrogateopt';
Problem.Aineq=A;
Problem.bineq=b;
Problem.options=options;
Problem.rngstate=rng(randi(10000),'twister');
intcon=[];
[Data,~,~,~,result]=surrogateopt(Problem);
%% in
for i=1:N
%% RNG TRY
[errorstruct.surrogate_rng.error(:,i),errorstruct.surrogate_rng.data(:,i),errorstruct.surrogate_rng.alldata(:,:,i)]=fun_Surrogate_problem_ver(anz,umschaltstellen,Costfunction,Sim,Startwerte);
end

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!