-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
108 lines (94 loc) · 3.31 KB
/
Snakefile
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
configfile: "experiments.yaml"
script_name = config["script_name"]
problem_name = config["problem"]
plot_out_dir = config["plot_out_dir"]
""""
# EXPERIMENT 1
rule all_parameters_experiment_1:
input:
expand("data/run_{run_i}_mlevery_{ml_every}_hlsplit_{hlsplit}_vehiclecrashworthiness.json",
run_i=range(1, config["runs_per_experiment"]+1),
ml_every=config["ml_every_n"],
hlsplit=[int(100*split) for split in config["hl_split"]],
problem_name=problem_name
)
rule parameters_experiment_1:
params:
run_i={"run_i"},
ml_every={"ml_every"},
hlsplit={"hlsplit"},
problem_name={"problem_name"}
output:
"data/run_{run_i}_mlevery_{ml_every}_hlsplit_{hlsplit}_vehiclecrashworthiness.json"
script:
"scripts/vehicle_crash_worthiness.py"
"""
# EXPERIMENT, collect data
rule all_parameters_experiment:
input:
expand("data/run_{run_i}_mlevery_{ml_every}_hlsplit_{hlsplit}_{problem_name}.json",
run_i=range(1, config["runs_per_experiment"]+1),
ml_every=config["ml_every_n"],
hlsplit=[int(100*split) for split in config["hl_split"]],
problem_name=problem_name
)
rule parameters_experiment:
params:
run_i={"run_i"},
ml_every={"ml_every"},
hlsplit={"hlsplit"},
output:
"data/run_{run_i}_mlevery_{ml_every}_hlsplit_{hlsplit}_{problem_name}.json"
script:
f"scripts/{script_name}"
# EXPERIMENT, calcualte statistics from data
rule all_statistics:
input:
expand("data/stats_mlevery_{ml_every}_hlsplit_{hlsplit}_{problem_name}.json",
ml_every=config["ml_every_n"],
hlsplit=[int(100*split) for split in config["hl_split"]],
problem_name=problem_name
)
rule statistics:
params:
run_i={"run_i"},
ml_every={"ml_every"},
hlsplit={"hlsplit"},
input:
expand("data/run_{run_i}_mlevery_{{ml_every}}_hlsplit_{{hlsplit}}_{{problem_name}}.json",
run_i=range(1, config["runs_per_experiment"]+1),
)
output:
"data/stats_mlevery_{ml_every}_hlsplit_{hlsplit}_{problem_name}.json"
script:
"scripts/calculate_statistics.py"
# PLOTTING, of heatmaps
rule all_heatmaps:
input:
expand("{plot_out_dir}/heatmap_{for_iter}_{problem_name}.pdf",
plot_out_dir=plot_out_dir,
for_iter=config["plot_for_each_iter"],
problem_name=problem_name)
rule heatmaps:
params:
plot_out_dir={"plot_out_dir"},
for_iter={"for_iter"},
problem_name={"problem_name"}
output:
"{plot_out_dir}/heatmap_{for_iter}_{problem_name}.pdf"
script:
"scripts/plot_freq_split_heat.py"
rule all_heatmaps_per_iter:
input:
expand("{plot_out_dir}/heatmaps_{measure}_{problem_name}.pdf",
plot_out_dir=plot_out_dir,
measure=["best", "mean", "hyper", "sum"],
problem_name=problem_name)
rule heatmaps_per_iter:
output:
"{plot_out_dir}/heatmaps_best_{problem_name}.pdf",
"{plot_out_dir}/heatmaps_mean_{problem_name}.pdf",
"{plot_out_dir}/heatmaps_hyper_{problem_name}.pdf",
"{plot_out_dir}/heatmaps_sum_{problem_name}.pdf"
script:
"scripts/plot_freq_split_heat_iters.py"