Surrogate optimization throws error when I try to use the vectorized option

1 回表示 (過去 30 日間)
Mohammad Shojaei Arani
Mohammad Shojaei Arani 2022 年 8 月 28 日
回答済み: Yash 2023 年 10 月 27 日
Hello,
Attemting to use vectorized option in surrogate optimization fails and I am not able to figour out
the reason behind. I get the following error message
'UseVectorized' is not an option for SURROGATEOPT.
A list of options can be found on the SURROGATEOPT documentation page.
Bellow, I show you the main part (L believe this should be enough)
options=optimoptions('surrogateopt','PlotFcn'[],'MaxFunctionEvaluations',10^8,'UseVectorized',true,'MinSurrogatePoints',200,'OutputFcn',@(x,optimValues,state)myoutput_Spline(x,optimValues,state,dt,M));
surrogateopt(cost,lb,ub,options)
Any idea?
Thanks a lot!
Babak
  4 件のコメント
Torsten
Torsten 2022 年 8 月 28 日
編集済み: Torsten 2022 年 8 月 28 日
Do you already get the error message when you form the options structure or after calling "surrogateopt" ?
What MATLAB version do you use ?
You noticed that you forgot a comma in your line of code ?
options=optimoptions('surrogateopt','PlotFcn'[],'MaxFunctionEvaluations',10^8,'UseVectorized',true,'MinSurrogatePoints',200,'OutputFcn',@(x,optimValues,state)myoutput_Spline(x,optimValues,state,dt,M));
-> here
Mohammad Shojaei Arani
Mohammad Shojaei Arani 2022 年 8 月 29 日
Hi Torsten,
I use matlab 2022. I checked again and could not find anything. I get error after calling 'surrogateopt'.
But, it does not matter. I am not actually using surrogate optimization (I got faster and more accurate results using particle swarm optimization).
Thanks again for your kind help!
Babak

サインインしてコメントする。

回答 (1 件)

Yash
Yash 2023 年 10 月 27 日
Hello Mohammad Shojaei Arani,
I understand that you are encountering issues while utilizing the Vectorized option in Surrogate Optimization in MATLAB. I have executed your code in MATLAB R2021a, MATLAB R2022a, and MATLAB R2023a, and I did not encounter any errors.
Upon careful examination, I noticed that the line you provided has a missing comma, which may be the cause of the issue. Here is the corrected code snippet:
options=optimoptions('surrogateopt','PlotFcn',[],'MaxFunctionEvaluations',10^8,'UseVectorized',true,'MinSurrogatePoints',200,'OutputFcn',@(x,optimValues,state)myoutput_Spline(x,optimValues,state,dt,M))
options =
surrogateopt options: Set properties: MaxFunctionEvaluations: 100000000 MinSurrogatePoints: 200 OutputFcn: @(x,optimValues,state)myoutput_Spline(x,optimValues,state,dt,M) PlotFcn: [] UseVectorized: 1 Default properties: BatchUpdateInterval: 1 CheckpointFile: [] ConstraintTolerance: 1.0000e-03 Display: 'final' InitialPoints: [] MaxTime: Inf MinSampleDistance: 1.0000e-06 ObjectiveLimit: -Inf UseParallel: 0
I recommend adding the missing comma to the code, as shown above. This adjustment should resolve the problem you are facing.
I hope this information helps you in resolving the issue.

カテゴリ

Help Center および File ExchangeSurrogate Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by