2 % -------------------------------------------------------------------------
3 % This file is part of BayesOpt, an efficient C++ library for
4 % Bayesian optimization.
6 % Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
8 % BayesOpt is free software: you can redistribute it and/or modify it
9 % under the terms of the GNU Affero General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or
11 % (at your option) any later version.
13 % BayesOpt is distributed in the hope that it will be useful, but
14 % WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 % GNU Affero General Public License
for more details.
18 % You should have received a copy of the GNU Affero General Public License
19 % along with BayesOpt. If not, see <http:
20 % ------------------------------------------------------------------------
23 function y = braninhighdim(x)
26 % Min = 0.5428 0.1517 => 0.3979
34 if (z(TRUE_I(1)) < 0) z(TRUE_I(1)) = 0; end;
35 if (z(TRUE_I(2)) < 0) z(TRUE_I(2)) = 0; end;
36 if (z(TRUE_I(1)) > 1) z(TRUE_I(1)) = 1; end;
37 if (z(TRUE_I(2)) > 1) z(TRUE_I(2)) = 1; end;
39 % Trick: We assume the
function has 1000 dims, but in reality, it is just
40 % the traditional 2D branin.
42 a = z(TRUE_I(1)) * 15 - 5;
43 b = z(TRUE_I(2)) * 15;
45 y = (b-(5.1/(4*pi^2))*a^2+5*a/pi-6)^2+10*(1-1/(8*pi))*cos(a)+10;