Modifying results from bayesopt

조회 수: 7 (최근 30일)
Alexander
Alexander 2017년 11월 9일
댓글: Alexander 2017년 11월 13일
Hey guys, following use case: I call bayesopt and get the results structure from it.
Now, the results structure contains a field, named 'NextPoint'. This is the x vector, which is going to be evaluated after a resuming. Given the fact, I know a better point, which is worth to be calculated next, how to replace the automatic one? A direct try yields
You cannot set the read-only property 'NextPoint' of BayesianOptimization.
error message.
  댓글 수: 1
Alexander
Alexander 2017년 11월 9일
To clarify:
1. I already tried to do this from an OutputFcn, with the same error;
2. I even know the function value at the "better point". So, indeed, I have not to recalculate it. I just want to apply some additional knowledge to the results structure of bayesopt, which can be used for continuation.

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

채택된 답변

Alan Weiss
Alan Weiss 2017년 11월 9일
In order to do this, I think that you are going to have to do two things:
  • Evaluate the point manually.
  • Start the Bayesian optimization afresh, using the returned points (the ones already evaluated by bayesopt) plus put in your new value and point. Use the 'InitialX' and 'Initial Objective' name-value pairs.
Please let us know if this works for you.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 2
Alexander
Alexander 2017년 11월 10일
편집: Alexander 2017년 11월 10일
Yes, this works. I was not aware, that 'XTrace' and 'ObjectiveTrace' holds the whole history of data, which I can reuse.
However, the result is somewhat disillusioning, as I tried to parallelize both: bayesopt as well as the manual evaluation of additional points, which does not play well together.
But the idea of setting 'InitialX' and 'InitialObjective' and restarting bayesopt works.
Thanks a lot :)
Alexander
Alexander 2017년 11월 13일
Ok, after some evaluation, I figured out the unexpected behavior. I attached an example.
Therein: as I understood correctly, what you suggested is the solution in lines 28-35.
However, if I add the ’UseParallel’ option, and provide the 'InitialX‘ array the optimizer does not restart. I didn’t find any documentation on the fact that setting 'InitialX‘ property together with ’UseParallel’ prevent the optimizer to run. Is this a bug?
What I did as a dirty workaround is in lines 25-26. However for being able to set XNext property I had to adjust the access modifier in BayesianOptimization.m to public, in line 1808.
Thanks anyway for help and any further comments.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by