-
Notifications
You must be signed in to change notification settings - Fork 17
/
example_addgp.m
36 lines (29 loc) · 1.05 KB
/
example_addgp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Copyright (c) 2017 Zi Wang
clear all; clc;
% add necessary paths
deploy;
% Define function
dx = 20;
xmin = zeros(dx,1);
xmax = ones(dx,1);
f = sample_addGP(dx, dx, xmin, xmax);
% Save the file to a path
options.savefilenm = [];
% Choose BO methods
options.bo_method = 'Add-MES-G';
% Set the number of maximums to sample
options.nK = 5;
% Set the GP hyper-parameters if you would like to fix them.
% Comment the following 3 lines out if you would like to learn them.
options.l = ones(1,dx)*50;
options.sigma = ones(1, dx)*5;
options.sigma0 = 0.0001*ones(1, dx);
% Start BO with add-GP
% add_gpopt does not support sampling multiple hyper-parameter settings.
% see sampleStructPriors.m for more details on learning hyper-parameters
% and the additive structure of the function.
% The additive learning strategy is based on the paper
% Wang, Zi and Li, Chengtao and Jegelka, Stefanie and Kohli, Pushmeet.
% Batched High-dimensional Bayesian Optimization via Structural Kernel
% Learning. arXiv preprint arXiv:1703.01973.
add_gpopt(f, xmin, xmax, 200, [], [], options)