Modifying results from bayesopt

2 次查看(过去 30 天)
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 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by