Effacer les filtres
Effacer les filtres

Modifying results from bayesopt

4 vues (au cours des 30 derniers jours)
Alexander
Alexander le 9 Nov 2017
Commenté : Alexander le 13 Nov 2017
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 commentaire
Alexander
Alexander le 9 Nov 2017
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.

Connectez-vous pour commenter.

Réponse acceptée

Alan Weiss
Alan Weiss le 9 Nov 2017
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 commentaires
Alexander
Alexander le 10 Nov 2017
Modifié(e) : Alexander le 10 Nov 2017
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 le 13 Nov 2017
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by