-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_table_elim.jl
78 lines (64 loc) · 2.8 KB
/
print_table_elim.jl
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
using JLD2;
using Printf;
using StatsPlots;
using LaTeXStrings;
using Statistics;
include("../../thresholds.jl")
include("../../peps.jl")
include("../../elimination_rules.jl")
include("../../stopping_rules.jl")
include("../../sampling_rules.jl")
include("../../experiment_helpers.jl")
normalize_samples = 1e3
normalize_times = 1e6
# BAI
files = ["experiments/saved_results/elim/elim_lin_BAI_LinGapE_K50_d10",
"experiments/saved_results/elim/elim_lin_BAI_LinGame_K50_d10",
"experiments/saved_results/elim/elim_lin_BAI_FWSampling_K50_d10",
"experiments/saved_results/elim/elim_lin_BAI_LazyTaS_K50_d10",
"experiments/saved_results/elim/elim_lin_BAI_FixedWeights_K50_d10",
"experiments/saved_results/elim/elim_lin_BAI_XYAdaptive_K50_d10",
"experiments/saved_results/elim/elim_lin_BAI_RAGE_K50_d10"];
alg_names = ["LinGapE", "LinGame", "FWS", "Lazy TaS", "Oracle", "XY-Adaptive", "RAGE"]
# Top-m
files = ["experiments/saved_results/elim/elim_lin_Topm_LinGapE_K50_d10",
"experiments/saved_results/elim/elim_lin_Topm_LinGame_K50_d10",
"experiments/saved_results/elim/elim_lin_Topm_FWSampling_K50_d10",
"experiments/saved_results/elim/elim_lin_Topm_LazyTaS_K50_d10",
"experiments/saved_results/elim/elim_lin_Topm_FixedWeights_K50_d10",
"experiments/saved_results/elim/elim_lin_Topm_LinGIFA_K50_d10"];
alg_names = ["m-LinGapE", "MisLid", "FWS", "Lazy TaS", "Oracle", "LinGIFA"]
for (f, alg) in zip(files, alg_names)
@load "$f.dat" θ pep stopping_rules sampling_rules elim_rules data δ β repeats seed
row = "& " * alg * " & "
samples = map(x -> sum(x[2])/normalize_samples, data); # (n_algos x n_repeats)
samples_mean = round.(mean(samples, dims=2), digits=2)
samples_std = round.(std(samples, dims=2), digits=1)
times = map(x -> sum(x[3])/normalize_times, data) ./ map(x -> sum(x[2]), data); # (n_algos x n_repeats)
times_mean = round.(mean(times, dims=2), digits=2)
times_std = std(times, dims=2)
if length(stopping_rules) == 1
row *= "& & & & "
row *= "\$$(samples_mean[1]) \\pm $(samples_std[1])\$ & \$$(times_mean[1])\$ & "
elseif length(stopping_rules) == 3
for i in 1:3
row *= "\$$(samples_mean[i]) \\pm $(samples_std[i])\$ & \$$(times_mean[i])\$ & "
end
elseif length(stopping_rules) == 5
for i in [1,2,4]
row *= "\$$(samples_mean[i]) \\pm $(samples_std[i])\$ & \$$(times_mean[i])\$ & "
end
row = row[1:end-2]
row *= "\\\\"
println(row)
row = "& " * alg * " + elim & & & "
for i in [3,5]
row *= "\$$(samples_mean[i]) \\pm $(samples_std[i])\$ & \$$(times_mean[i])\$ & "
end
else
@assert false
end
row = row[1:end-2]
row *= "\\\\"
println(row)
end