Can bayesopt() be run without an objective function call?

5 ビュー (過去 30 日間)
David Freiberg
David Freiberg 2018 年 2 月 20 日
コメント済み: xu supeng 2020 年 6 月 24 日
I have a list of initial X values and initial objectives, as well as variable ranges and parameters, but would like to just extract the next suggested point to sample with bayesObject('NextPoint'), because the evaluation is not a function I can easily put into MATLAB. I attempted to make a dummy function with the correct number of inputs and set 'MaxObjectiveEvaluations' to 0 to avoid any actual function calls:
bayesObject = bayesopt(dummyFunc,var1,'InitialX',initialXList,'InitialObjective',initialObjList,'MaxObjectiveEvaluations',0);
but received the error
Error using bayesoptim.BayesoptOptions/checkAndFillStoppingCriteria (line X)
'MaxObjectiveEvaluations' must be a positive integer.
Can the 'NextPoint' property be called without ever calling the dummy function? Alternatively, is there a different function I should be using rather than bayesopt() for this?

採用された回答

Don Mathis
Don Mathis 2018 年 2 月 22 日
How about this?
  • The objective function returns 0 but is never called.
  • The initial points are counted as objective evaluations and so you can set MaxObjectiveEvaluations to 1 and no evaluations will actually occur.
  • Plotting and Verbose are turned off so it's fast and silent. (Takes about 0.1 seconds on my machine).
rng(0)
var1 = optimizableVariable('X', [-1,1]);
initialXList = table;
initialXList.X = rand(5,1)*2 - 1;
initialObjList = initialXList.X .^2;
dummyFunc = @(Tbl)0;
bayesObject = bayesopt(dummyFunc,var1,...
'InitialX',initialXList,...
'InitialObjective',initialObjList,...
'MaxObjectiveEvaluations',1, ...
'PlotFcn',{},...
'Verbose',0);
bayesObject.NextPoint
  2 件のコメント
David Freiberg
David Freiberg 2018 年 2 月 22 日
This worked perfectly - I didn't realize that 'InitialX' counted towards the number of function evaluations. Thank you very much.
xu supeng
xu supeng 2020 年 6 月 24 日
Could you help me to see my Question, I followed your method to write a program, but it seems the final result is related to the objective function value(for example if I set dummyFunc = @(Tbl)0 or dummyFunc = @(Tbl)100 the final results are different), but here you say the objective function is never called, here is my question,

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModel Building and Assessment についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by