-
Notifications
You must be signed in to change notification settings - Fork 2
Entropy search
bajeluk edited this page Mar 12, 2013
·
2 revisions
very brief testing
- download the source code from http://www.probabilistic-optimization.org/Global.html
- install additional Matlab packages logsumexp and tprod and GPML
- run, for example, the following code:
% Entropy Search (Henning, 2012) example clear f = @(x) sin(x) % function to optimize cd /mnt/win/new/doc/skola/phd/2013/03_bbob-2013/EntropySearch/ in.covfunc = {@covSEard}; % GP kernel in.covfunc_dx = {@covSEard_dx_MD}; % derivative of GP kernel. You can use covSEard_dx_MD and covRQard_dx_MD if you use Carl's & Hannes' covSEard, covRQard, respectively. in.xmin = 0; % input space bounds in.xmax = 2*pi; in.f = f; % function to optimize addpath ~/prg/gpeda/src/vendor/gpml-matlab-v3.2/ startup % startup of GPML N = 1; % input dimension hyp.cov = log([ones(N,1);1]); % hyperparameters for the kernel hyp.lik = log([1e-3]); % noise level on signals (log(standard deviation)); in.hyp = hyp; % hyperparameters, with fields .lik (noise level) and .cov (kernel hyperparameters), see documentation of the kernel functions for details. in.LearnHypers = true; % yes. in.HyperPrior = @SEGammaHyperPosterior; addpath ~/tmp/tprod/ % tprod C++/mex64 library in.MaxEval = 5; % 5 evaluations at maximum (it still takes about 2 min) % EntropySearch itself result = EntropySearch(in) % Visualization of results % just brief intro... f(result.FunEst) xx = linspace(0,2*pi,50); plot(xx,f(xx)); hold on; scatter(result.FunEst, f(result.FunEst), 'ro'); hold off; % All 5 models visualization for i = 1:5 subplot(1,5,i); [my_m my_s2] = gp(result.GPs{i}.hyp, [], [], result.GPs{i}.covfunc, result.GPs{i}.likfunc, result.FunEst(1:i,:), f(result.FunEst(1:i,:)), xx'); plotErr1(xx', my_m, my_s2, result.FunEst(1:i,:)', f(result.FunEst(1:i,:)')); axis([0 2*pi -2 2]); end;