External Variables in bayesopt Objective Function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Daniel Gordon
le 25 Jan 2019
Réponse apportée : Walter Roberson
le 25 Jan 2019
Hello,
I am making use of bayesopt within Matlab. According to the documentation, the objective function must have the following signature:
result = objectiveFunction(X)
where X is a struct/table giving the values of the optimisation variables to be used to analyse the objective function at this particular iteration.
My issue is that the objective function I wish to use depends on some external variables as well as X. To be clear, these external variables will never change throughout a single Bayesian optimisation, and so they are not themselves optimisation variables. In theory they could be hard coded in to the objective function itself, but this would not be very efficient to run multiple experiments.
As an example: one external variable I need is 'model_file'. This is set before the bayesopt starts and defines a model which is loaded & used to perform some dynamic calculations within the objective function. Typically every time we run a new experiment either the model_file or other external variables are changed.
Currently I am considering solutions whereby the external variables are defined globally in the script which runs bayesopt, but I was wondering if there is a nicer solution to this? Ideally I would have something like:
result = objectiveFunction(X, external_variables)
But it seems like this is not possible?
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Model Building and Assessment dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!