-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis.py
executable file
·196 lines (153 loc) · 4.13 KB
/
analysis.py
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
from analysis_functions.run_analysis import MOQD_Analysis
# Parent directory of results
parent_dirname = "results/"
# Directory names of experiments
experiment_names = [
# main
# "mome",
"mome_biased",
# "mome_biased",
# "mome_biased_addition",
# "mome_biased_selection",
# baselines
"map_elites_sum",
"map_elites_energy",
"map_elites_magmom",
]
# Directory names of environments
env_names=[
"C",
"Si",
"SiC",
"SiO2",
"TiO2",
]
experiment_dicts = {
## MAIN
"mome_biased": {
"label": "MOME-X",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "solid",
},
"mome_biased_selection": {
"label": "MOME-Crowding-Selection",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "solid",
},
"mome_biased_addition": {
"label": "MOME-Crowding-Addition",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "solid",
},
## BASELINES
"mome": {
"label": "MOME",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "dashed",
},
"map_elites_energy": {
"label": "MAP-Elites (Energy)",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "dashed"
},
"map_elites_magmom": {
"label": "MAP-Elites (Magmom)",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "dotted"
},
"map_elites_sum": {
"label": "MAP-Elites (Sum)",
"emitter_names": [],
"emitter_labels": [],
"grid_plot_linestyle": "dashdot"
},
}
env_dicts = {
"C": {
"label": "C",
"reward_labels": ["Energy", "Magmom"],
"reference_point": [0, 0],
"exceptions": [],
},
"Si": {
"label": "Si",
"reward_labels": ["Energy", "Magmom"],
"reference_point": [0, 0],
"exceptions": [],
},
"SiC": {
"label": "SiC",
"reward_labels": ["Energy", "Magmom"],
"reference_point": [0, 0],
"exceptions": [],
},
"SiO2": {
"label": "SiO2",
"reward_labels": ["Energy", "Magmom"],
"reference_point": [0, 0],
"exceptions": [],
},
"TiO2": {
"label": "TiO2",
"reward_labels": ["Energy", "Magmom"],
"reference_point": [0, 0],
"exceptions": [],
},
}
# List of metrics to calculate p-values for
p_value_metrics_list = [
"moqd_score",
]
# Which algorithms to compare data-efficiency and which metric for comparison
data_efficiency_params={}
if __name__ == "__main__":
analysis_helper = MOQD_Analysis(
parent_dirname=parent_dirname,
env_names=env_names,
env_dicts=env_dicts,
experiment_names=experiment_names,
experiment_dicts=experiment_dicts,
num_replications=10,
num_iterations=50,
episode_length=0,
batch_size=100
)
# Metrics to plot in grid plot
grid_plot_metrics_list = [
"moqd_score",
"energy_qd_score",
"magmom_qd_score",
# "max_energy_fitness",
# "max_magmom_fitness",
# "global_hypervolume",
# "max_sum_scores",
# "num_solutions",
# "coverage"
]
grid_plot_metrics_labels = {
"moqd_score": "MOQD Score",
"energy_qd_score": "Energy QD Score",
"magmom_qd_score": "Magmom QD Score",
"max_energy_fitness": "Max Energy Fitness",
"max_magmom_fitness": "Max Magmom Fitness",
"global_hypervolume": "Global Hypervolume",
"max_sum_scores": "Max Sum Scores",
"num_solutions": "Number of Solutions",
"coverage": "Coverage",
}
# analysis_helper.plot_grid(
# grid_plot_metrics_list,
# grid_plot_metrics_labels,
# )
analysis_helper.analyse_gold_matches()
# analysis_helper.plot_final_pfs()
# analysis_helper.calculate_wilcoxon(
# p_value_metrics_list
# )
# analysis_helper.sparsity_analysis()