-
Notifications
You must be signed in to change notification settings - Fork 0
/
GP_agree.m
executable file
·91 lines (74 loc) · 2.54 KB
/
GP_agree.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
clear;
summary = REDU_MeasureAgreement('.\Results\MegaRFZombie\init_file_2f.mat', '.\Results\MegaRFZombie\output', ones(1,33));
load .\Results\MegaRFZombie\init_file_2f;
%%
grid = zeros(7,20);
idx = [];
k = 1;
for i = 1 : length(alpha)
% if(abs(alpha{i}(1) - 0.24) < 0.005)
grid(:,k) = alpha{i};
idx = [idx i];
k = k + 1;
% end
end
%%
% finest_grid = zeros(4,20); %)
i = 1;
%
% alpha_kernels = cover_simplex(3,[0.0:0.01:1],1);
% k = 1;
% for alpha_unary = 0.24%:0.005:0.3
% for j = 1 : length(alpha_kernels)
% finest_grid(:,k) = [alpha_unary alpha_kernels{j}];
% k = k + 1;
% end
% end
% transfer_cost_n = summary.transfer_cost + 34 * summary.miss;
% transfer_cost_n = transfer_cost_n / max(transfer_cost_n);
% transfer_cost_n = 1 - transfer_cost_n;
measurements = summary.tot_per_class_aggr * 10000;
finest_grid = grid;
grid = grid(:,[15 100]);
full_measurements = measurements;
measurements = measurements(1,[15 100 ]);
%%
iter_num = 100;
%figure;
% [rounds_vs_max measurements_new cov_evolit_is_const] = ...
% SearchGridGP_randomized(grid, finest_grid, full_measurements, measurements,iter_num, 1);
[rounds_vs_max measurements_new cov_evolve it_is_const] = SearchGridGP(grid, finest_grid, full_measurements, measurements,iter_num, 0.01, false);
% for beta = [0.001 0.01 0.1 1 ]
% [rounds_vs_max measurements_new] = SearchGridGP(grid, finest_grid, full_measurements, measurements,iter_num, beta);
% plot(rounds_vs_max, 'b');
% hold on
% end
figure
plot(rounds_vs_max, 'b');
hold on
% legend('0.001', '0.01', '0.1', '1');
%%
iter_num = 100;
%figure;
% [rounds_vs_max measurements_new cov_evolit_is_const] = ...
% SearchGridGP_randomized(grid, finest_grid, full_measurements, measurements,iter_num, 1);
[rounds_vs_max measurements_new cov_evolve it_is_const] = SearchGridGP(grid, finest_grid, full_measurements, measurements,iter_num, 0.01, true);
% for beta = [0.001 0.01 0.1 1 ]
% [rounds_vs_max measurements_new] = SearchGridGP(grid, finest_grid, full_measurements, measurements,iter_num, beta);
% plot(rounds_vs_max, 'b');
% hold on
% end
%figure
plot(rounds_vs_max, 'g');
% legend('0.001', '0.01', '0.1', '1');
%%
iter_num = 150
rounds_vs_max = zeros(1,iter_num + 1);
for i = 1 : 100
[rounds_vs_max_cur measurements_cur] = SearchGridRandom(grid, finest_grid, full_measurements, measurements, iter_num);
rounds_vs_max = rounds_vs_max + rounds_vs_max_cur;
end
plot(rounds_vs_max / 100, 'r');
title('Weakly supervised learning');
Xlabel('queried points');
Ylabel('found optimum / global optimum');