-
Notifications
You must be signed in to change notification settings - Fork 3
/
gpModelSetup.m
136 lines (95 loc) · 4.83 KB
/
gpModelSetup.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
function GPModel = gpModelSetup(GPModel, Options)
if ischar(GPModel)
GPModel = struct('gp_name', GPModel);
end
GPModel.m = Options.m;
GPModel.n = Options.n;
GPModel.Options = Options;
if isProperlySet(Options, 'run_info_str')
GPModel.run_info_str = Options.run_info_str;
else
GPModel.run_info_str = '';
end
meltStruct(GPModel.Options);
switch GPModel.gp_name
case 'cholqr'
GPModel.(GPModel.gp_name).delta = GPModel.Options.delta;
assert(isProperlySet(GPModel.(GPModel.gp_name), 'delta'));
GPModel.run_info_str = [GPModel.run_info_str ...
sprintf('_delta%d', GPModel.(GPModel.gp_name).delta)];
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name), 'max_swap_per_epoch', ...
min(60, GPModel.Options.m));
GPModel.run_info_str = [GPModel.run_info_str '_MaxSwapPE' ...
num2str(GPModel.(GPModel.gp_name).max_swap_per_epoch)];
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name),'use_cache', false);
if GPModel.(GPModel.gp_name).use_cache
GPModel.run_info_str = [GPModel.run_info_str , '_cacheOn'];
end
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name), 'random_swap_order', true);
if GPModel.(GPModel.gp_name).random_swap_order
GPModel.run_info_str = [GPModel.run_info_str '_RandSwapOrder'];
end
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name), 'swap_info_pivots', true);
if GPModel.(GPModel.gp_name).swap_info_pivots
GPModel.run_info_str = [GPModel.run_info_str '_ReInfo'];
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name),'max_num_info_revisit',...
ceil(GPModel.(GPModel.gp_name).max_swap_per_epoch / 5));
GPModel.run_info_str = [GPModel.run_info_str , ...
sprintf('_maxNReInfo%d', ...
GPModel.(GPModel.gp_name).max_num_info_revisit)];
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name),'use_rand_info', true);
if GPModel.(GPModel.gp_name).use_rand_info
GPModel.run_info_str = [GPModel.run_info_str '_RandInfo'];
else
error('Not supported');
% GPModel.(GPModel.gp_name) = ...
% smartAssignVar(GPModel.(GPModel.gp_name),'reShuffleInfoPJmaxBound',...
% log(1+(1/(GPModel.m^2))));
%
% GPModel.(GPModel.gp_name) = ...
% smartAssignVar(GPModel.(GPModel.gp_name),'d_ratio', .5);
end
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name),'pre_scheduled_reinfo', true);
if GPModel.(GPModel.gp_name).pre_scheduled_reinfo
GPModel.run_info_str = [GPModel.run_info_str '_ReInfoPreSched'];
end
end
% GPModel.(GPModel.gp_name) = ...
% smartAssignVar(GPModel.(GPModel.gp_name),'adapt_info_size_rate',[]);
%
% if isProperlySet(GPModel.(GPModel.gp_name),'adapt_info_size_rate')
%
%
%
% GPModel.run_info_str = [GPModel.run_info_str , '_AZR' ...
% sprintf('%g',GPModel.(GPModel.gp_name).adapt_info_size_rate)];
% end
% GPModel.(GPModel.gp_name) = ...
% smartAssignVar(GPModel.(GPModel.gp_name),'adapt_reinfo_rate',[]);
%
% if isProperlySet(GPModel.(GPModel.gp_name),'adapt_reinfo_rate')
%
% GPModel.(GPModel.gp_name).num_info_revisit = 2;
%
% GPModel.run_info_str = [GPModel.run_info_str , '_ARI' ...
% sprintf('%g',GPModel.(GPModel.gp_name).adapt_info_size_rate)];
% end
GPModel.(GPModel.gp_name) = ...
smartAssignVar(GPModel.(GPModel.gp_name),'do_var_cost', true);
GPModel.do_var_cost = GPModel.(GPModel.gp_name).do_var_cost;
if GPModel.(GPModel.gp_name).do_var_cost
GPModel.run_info_str = [GPModel.run_info_str, '_NVF'];
end
otherwise
error('Unsupported GP type');
end
% if isProperlySet(GPModel.Options, 'fold_ind')
% GPModel.run_info_str = [GPModel.run_info_str, sprintf('_fold%d',GPModel.Options.fold_ind)];
% end