-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexperiment_threshold.jl
More file actions
39 lines (34 loc) · 1.23 KB
/
experiment_threshold.jl
File metadata and controls
39 lines (34 loc) · 1.23 KB
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
######################################################################################################
# Copy from https://github.com/xuedong/LinBAI.jl by Xuedong Shang #
######################################################################################################
using JLD2;
using Distributed;
using Printf;
@everywhere include("runit_threshold.jl");
@everywhere include("../utilities/thresholds.jl");
include("../utilities/experiment_helpers.jl");
# setup
dist = Gaussian();
dim = 6;
μ = zeros(dim); µ[1] = 1.;
arms = Vector{Float64}[]
for k in 1:dim
v = zeros(dim); v[k] = 1.; push!(arms, v);
end
ω = 0.01; v = zeros(dim); v[1] = cos(ω); v[2] = sin(ω); push!(arms, v)
threshold = 0.9;
pep = LinearThreshold(dist, arms, threshold);
srs = [FWSampling(), ConvexGame(CTracking), LearnerK(CTracking), RoundRobin()];
δs = (0.1,0.01,0.001,0.0001); # confidence
βs = GK16.(δs);
repeats = 1000;
seed = 1234;
# compute
@time data = pmap(
((sr,i),) -> runit(seed+i, sr, μ, pep, βs),
Iterators.product(srs, 1:repeats)
);
dump_stats(pep, μ, δs, βs, srs, data, repeats);
# save
@save isempty(ARGS) ? "Threshold.dat" : ARGS[1] dist μ pep srs data δs βs repeats seed
# visualise by loading viz.jl