Skip to content

Commit 2141912

Browse files
authored
Merge pull request #418 from anyangml2nd/fix/barplot-datastructure
refactor: Reorient generalizability downstream score results to be ke…
2 parents bdeee3d + 6cf0b35 commit 2141912

2 files changed

Lines changed: 37 additions & 51 deletions

File tree

Lines changed: 35 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,38 @@
11
{
2-
"DPA-3.1-3M": {
3-
"Inorganic Materials": 0.07,
4-
"Molecules": 0.29,
5-
"Catalysis": 0.53
6-
},
7-
"Orb-v3-omat": {
8-
"Inorganic Materials": 0.07,
9-
"Molecules": 0.42,
10-
"Catalysis": 0.84
11-
},
12-
"SevenNet-MF-ompa": {
13-
"Inorganic Materials": 0.06,
14-
"Molecules": 0.53,
15-
"Catalysis": 0.84
16-
},
17-
"MatterSim-v1-5M": {
18-
"Inorganic Materials": 0.09,
19-
"Molecules": 0.49,
20-
"Catalysis": 0.91
21-
},
22-
"GRACE-2L-OAM": {
23-
"Inorganic Materials": 0.06,
24-
"Molecules": 0.48,
25-
"Catalysis": 0.75
26-
},
27-
"MACE-MH-1": {
28-
"Inorganic Materials": 0.07,
29-
"Molecules": 0.22,
30-
"Catalysis": 0.51
31-
},
32-
"DPA-3.2-5M": {
33-
"Inorganic Materials": 0.06,
34-
"Molecules": 0.17,
35-
"Catalysis": 0.56
36-
},
37-
"DPA-2.4-7M": {
38-
"Inorganic Materials": 0.13,
39-
"Molecules": 0.4,
40-
"Catalysis": 0.62
41-
},
42-
"MACE-MPA-0": {
43-
"Inorganic Materials": 0.08,
44-
"Molecules": 0.57,
45-
"Catalysis": 0.76
46-
},
47-
"Orb-v2": {
48-
"Inorganic Materials": 0.34,
49-
"Molecules": 0.47,
50-
"Catalysis": 0.85
2+
"Inorganic Materials": {
3+
"DPA-3.1-3M": 0.07,
4+
"Orb-v3-omat": 0.07,
5+
"SevenNet-MF-ompa": 0.06,
6+
"MatterSim-v1-5M": 0.09,
7+
"GRACE-2L-OAM": 0.06,
8+
"MACE-MH-1": 0.07,
9+
"DPA-3.2-5M": 0.06,
10+
"DPA-2.4-7M": 0.13,
11+
"MACE-MPA-0": 0.08,
12+
"Orb-v2": 0.34
13+
},
14+
"Molecules": {
15+
"DPA-3.1-3M": 0.29,
16+
"Orb-v3-omat": 0.42,
17+
"SevenNet-MF-ompa": 0.53,
18+
"MatterSim-v1-5M": 0.49,
19+
"GRACE-2L-OAM": 0.48,
20+
"MACE-MH-1": 0.22,
21+
"DPA-3.2-5M": 0.17,
22+
"DPA-2.4-7M": 0.4,
23+
"MACE-MPA-0": 0.57,
24+
"Orb-v2": 0.47
25+
},
26+
"Catalysis": {
27+
"DPA-3.1-3M": 0.53,
28+
"Orb-v3-omat": 0.84,
29+
"SevenNet-MF-ompa": 0.84,
30+
"MatterSim-v1-5M": 0.91,
31+
"GRACE-2L-OAM": 0.75,
32+
"MACE-MH-1": 0.51,
33+
"DPA-3.2-5M": 0.56,
34+
"DPA-2.4-7M": 0.62,
35+
"MACE-MPA-0": 0.76,
36+
"Orb-v2": 0.85
5137
}
5238
}

lambench/metrics/vishelper/metrics_calculations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def calculate_generalizability_ood_error_metric(self) -> dict[str, float]:
8383
model: np.mean(values) for model, values in rearranged_m_bar_domain.items()
8484
}
8585

86-
def calculate_generalizability_downstream_score(self) -> dict[str, float]:
86+
def calculate_generalizability_downstream_score(self) -> tuple[dict, dict]:
8787
raw_results = self.fetcher.fetch_downstream_results()
8888

8989
# Extract necessary columns and prepare penalty dict
@@ -159,7 +159,7 @@ def calculate_generalizability_downstream_score(self) -> dict[str, float]:
159159
) # drop models with missing domain results
160160

161161
# # Now aggregate all domains to get the final generalizability metrics for each model
162-
return domain_results, domain_results.mean(axis=1).to_dict()
162+
return domain_results.to_dict(orient="index"), domain_results.mean(axis=1).to_dict()
163163

164164
def calculate_stability_results(self) -> dict[str, float]:
165165
"""This calculates the stability score for a given LAM."""

0 commit comments

Comments
 (0)