Effacer les filtres
Effacer les filtres

Return user data from bayesopt

6 vues (au cours des 30 derniers jours)
Pablo García Auñón
Pablo García Auñón le 26 Sep 2017
I am using bayesopt to minimize an objective function. Besides the minimum value of the function, I would like to have addintional information generated inside it when the minimization is completed. A simplified problem would be:
x = optimizableVariable('x',[0,10]);
f_eval = @(x)fun(x);
results = bayesopt(f_eval,x);
function [fitness,userData] = fun(x)
fitness = x.x^2 - 2*x.x + 1;
userData = x.x^3;
end
So I would like to see inside results the value of userData for which x results in a minimum fitness function.
Any idea how to do it?
Thanks!! Pablo

Réponse acceptée

Alan Weiss
Alan Weiss le 26 Sep 2017
The syntax for writing an objective function that outputs extra user data is described here. You can see an example here.
Notice that results contains a UserDataTrace property.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 commentaire
Pablo García Auñón
Pablo García Auñón le 26 Sep 2017
Thanks, I works!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by