Spaces:
Running
Running
add warning pre-alpha message, add equiformer-oc20
Browse files
mlip_arena/tasks/diatomics/equiformer/homonuclear-diatomics.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
serve/app.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
4 |
-
|
5 |
# if "logged_in" not in st.session_state:
|
6 |
# st.session_state.logged_in = False
|
7 |
|
@@ -19,7 +17,7 @@ import streamlit as st
|
|
19 |
# logout_page = st.Page(logout, title="Log out", icon=":material/logout:")
|
20 |
|
21 |
leaderboard = st.Page(
|
22 |
-
"
|
23 |
)
|
24 |
# bugs = st.Page("models/bugs.py", title="Bug reports", icon=":material/bug_report:")
|
25 |
# alerts = st.Page(
|
@@ -55,7 +53,7 @@ if pg in [stability, combustion]:
|
|
55 |
page_icon=":shark:",
|
56 |
initial_sidebar_state="expanded",
|
57 |
menu_items={
|
58 |
-
"About":
|
59 |
"Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
|
60 |
}
|
61 |
)
|
@@ -66,9 +64,11 @@ else:
|
|
66 |
page_icon=":shark:",
|
67 |
initial_sidebar_state="expanded",
|
68 |
menu_items={
|
69 |
-
"About":
|
70 |
"Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
|
71 |
}
|
72 |
)
|
73 |
|
74 |
-
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
|
|
|
|
3 |
# if "logged_in" not in st.session_state:
|
4 |
# st.session_state.logged_in = False
|
5 |
|
|
|
17 |
# logout_page = st.Page(logout, title="Log out", icon=":material/logout:")
|
18 |
|
19 |
leaderboard = st.Page(
|
20 |
+
"leaderboard.py", title="Leaderboard", icon=":material/trophy:"
|
21 |
)
|
22 |
# bugs = st.Page("models/bugs.py", title="Bug reports", icon=":material/bug_report:")
|
23 |
# alerts = st.Page(
|
|
|
53 |
page_icon=":shark:",
|
54 |
initial_sidebar_state="expanded",
|
55 |
menu_items={
|
56 |
+
"About": "https://github.com/atomind-ai/mlip-arena",
|
57 |
"Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
|
58 |
}
|
59 |
)
|
|
|
64 |
page_icon=":shark:",
|
65 |
initial_sidebar_state="expanded",
|
66 |
menu_items={
|
67 |
+
"About": "https://github.com/atomind-ai/mlip-arena",
|
68 |
"Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
|
69 |
}
|
70 |
)
|
71 |
|
72 |
+
st.toast("MLIP Arena is currently in **pre-alpha**. The results are not stable. Please interpret them with care. Contributions are welcome. For more information, visit https://github.com/atomind-ai/mlip-arena.", icon="🍞")
|
73 |
+
|
74 |
+
pg.run()
|
serve/{models/leaderboard.py → leaderboard.py}
RENAMED
@@ -50,14 +50,17 @@ s = table.style.background_gradient(
|
|
50 |
vmin=0, vmax=120
|
51 |
)
|
52 |
|
|
|
|
|
|
|
53 |
st.markdown(
|
54 |
"""
|
55 |
<h1 style='text-align: center;'>⚔️ MLIP Arena Leaderboard ⚔️</h1>
|
|
|
|
|
56 |
""", unsafe_allow_html=True)
|
57 |
|
58 |
-
# st.image("")
|
59 |
|
60 |
-
# st.markdown("# MLIP Arena Leaderboard")
|
61 |
|
62 |
st.dataframe(
|
63 |
s,
|
|
|
50 |
vmin=0, vmax=120
|
51 |
)
|
52 |
|
53 |
+
st.warning("MLIP Arena is currently in **pre-alpha**. The results are not stable. Please interpret them with care.", icon="⚠️")
|
54 |
+
st.info("Contributions are welcome. For more information, visit https://github.com/atomind-ai/mlip-arena.", icon="🤗")
|
55 |
+
|
56 |
st.markdown(
|
57 |
"""
|
58 |
<h1 style='text-align: center;'>⚔️ MLIP Arena Leaderboard ⚔️</h1>
|
59 |
+
|
60 |
+
MLIP Arena is a platform for benchmarking foundation machine learning interatomic potentials (MLIPs).
|
61 |
""", unsafe_allow_html=True)
|
62 |
|
|
|
63 |
|
|
|
64 |
|
65 |
st.dataframe(
|
66 |
s,
|
serve/tasks/homonuclear-diatomics.py
CHANGED
@@ -12,7 +12,7 @@ from scipy.interpolate import CubicSpline
|
|
12 |
from mlip_arena.models import REGISTRY
|
13 |
|
14 |
st.markdown(
|
15 |
-
"""
|
16 |
# Homonuclear Diatomics
|
17 |
|
18 |
Homonuclear diatomics are molecules composed of two atoms of the same element.
|
@@ -22,8 +22,16 @@ The potential energy curves of homonuclear diatomics are the most fundamental in
|
|
22 |
|
23 |
st.markdown("### Methods")
|
24 |
container = st.container(border=True)
|
25 |
-
valid_models = [
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
dft_methods = container.multiselect("DFT Methods", ["GPAW"], [])
|
28 |
|
29 |
st.markdown("### Settings")
|
@@ -34,38 +42,46 @@ ncols = vis.select_slider("Number of columns", options=[1, 2, 3, 4], value=2)
|
|
34 |
|
35 |
# Get all attributes from pcolors.qualitative
|
36 |
all_attributes = dir(pcolors.qualitative)
|
37 |
-
color_palettes = {
|
|
|
|
|
|
|
|
|
38 |
color_palettes.pop("__all__", None)
|
39 |
|
40 |
palette_names = list(color_palettes.keys())
|
41 |
palette_colors = list(color_palettes.values())
|
42 |
|
43 |
-
palette_name = vis.selectbox(
|
44 |
-
"Color sequence",
|
45 |
-
options=palette_names, index=22
|
46 |
-
)
|
47 |
|
48 |
-
color_sequence = color_palettes[palette_name]
|
49 |
|
50 |
DATA_DIR = Path("mlip_arena/tasks/diatomics")
|
51 |
-
if not
|
52 |
st.stop()
|
53 |
-
dfs = [pd.read_json(DATA_DIR / REGISTRY[method]["family"] / "homonuclear-diatomics.json") for method in methods]
|
54 |
-
|
55 |
-
dfs.extend([pd.read_json(DATA_DIR / method.lower() / "homonuclear-diatomics.json") for method in dft_methods])
|
56 |
-
|
57 |
-
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
df = pd.concat(dfs, ignore_index=True)
|
60 |
df.drop_duplicates(inplace=True, subset=["name", "method"])
|
61 |
|
62 |
-
method_color_mapping = {
|
|
|
|
|
|
|
63 |
|
64 |
# img_dir = Path('./images')
|
65 |
# img_dir.mkdir(exist_ok=True)
|
66 |
|
67 |
for i, symbol in enumerate(chemical_symbols[1:]):
|
68 |
-
|
69 |
if i % ncols == 0:
|
70 |
cols = st.columns(ncols)
|
71 |
|
@@ -79,6 +95,8 @@ for i, symbol in enumerate(chemical_symbols[1:]):
|
|
79 |
elo, flo = float("inf"), float("inf")
|
80 |
|
81 |
for j, method in enumerate(rows["method"].unique()):
|
|
|
|
|
82 |
row = rows[rows["method"] == method].iloc[0]
|
83 |
|
84 |
rs = np.array(row["R"])
|
@@ -101,7 +119,7 @@ for i, symbol in enumerate(chemical_symbols[1:]):
|
|
101 |
fs = fs[ind]
|
102 |
|
103 |
if "GPAW" in method:
|
104 |
-
xs = np.linspace(rs.min()*0.99, rs.max()*1.01, int(5e2))
|
105 |
else:
|
106 |
xs = rs
|
107 |
|
@@ -112,11 +130,12 @@ for i, symbol in enumerate(chemical_symbols[1:]):
|
|
112 |
else:
|
113 |
ys = es
|
114 |
|
115 |
-
elo = min(elo, max(ys.min()*1.2, -15), -1)
|
116 |
|
117 |
fig.add_trace(
|
118 |
go.Scatter(
|
119 |
-
x=xs,
|
|
|
120 |
mode="lines",
|
121 |
line=dict(
|
122 |
color=method_color_mapping[method],
|
@@ -130,11 +149,12 @@ for i, symbol in enumerate(chemical_symbols[1:]):
|
|
130 |
if force_plot and "GPAW" not in method:
|
131 |
ys = fs
|
132 |
|
133 |
-
flo = min(flo, max(ys.min()*1.2, -50))
|
134 |
|
135 |
fig.add_trace(
|
136 |
go.Scatter(
|
137 |
-
x=xs,
|
|
|
138 |
mode="lines",
|
139 |
line=dict(
|
140 |
color=method_color_mapping[method],
|
@@ -160,22 +180,20 @@ for i, symbol in enumerate(chemical_symbols[1:]):
|
|
160 |
|
161 |
# Set y-axes titles
|
162 |
if energy_plot:
|
163 |
-
|
164 |
fig.update_layout(
|
165 |
yaxis=dict(
|
166 |
title=dict(text="Energy [eV]"),
|
167 |
side="left",
|
168 |
-
range=[elo, 1.5*(abs(elo))],
|
169 |
)
|
170 |
)
|
171 |
|
172 |
if force_plot:
|
173 |
-
|
174 |
fig.update_layout(
|
175 |
yaxis2=dict(
|
176 |
title=dict(text="Force [eV/Å]"),
|
177 |
side="right",
|
178 |
-
range=[flo, 1.0*abs(flo)],
|
179 |
overlaying="y",
|
180 |
tickmode="sync",
|
181 |
),
|
|
|
12 |
from mlip_arena.models import REGISTRY
|
13 |
|
14 |
st.markdown(
|
15 |
+
"""
|
16 |
# Homonuclear Diatomics
|
17 |
|
18 |
Homonuclear diatomics are molecules composed of two atoms of the same element.
|
|
|
22 |
|
23 |
st.markdown("### Methods")
|
24 |
container = st.container(border=True)
|
25 |
+
valid_models = [
|
26 |
+
model
|
27 |
+
for model, metadata in REGISTRY.items()
|
28 |
+
if Path(__file__).stem in metadata.get("gpu-tasks", [])
|
29 |
+
]
|
30 |
+
mlip_methods = container.multiselect(
|
31 |
+
"MLIPs",
|
32 |
+
valid_models,
|
33 |
+
["EquiformerV2(OC22)", "eSCN(OC20)", "CHGNet", "M3GNet", "MACE-MP(M)"],
|
34 |
+
)
|
35 |
dft_methods = container.multiselect("DFT Methods", ["GPAW"], [])
|
36 |
|
37 |
st.markdown("### Settings")
|
|
|
42 |
|
43 |
# Get all attributes from pcolors.qualitative
|
44 |
all_attributes = dir(pcolors.qualitative)
|
45 |
+
color_palettes = {
|
46 |
+
attr: getattr(pcolors.qualitative, attr)
|
47 |
+
for attr in all_attributes
|
48 |
+
if isinstance(getattr(pcolors.qualitative, attr), list)
|
49 |
+
}
|
50 |
color_palettes.pop("__all__", None)
|
51 |
|
52 |
palette_names = list(color_palettes.keys())
|
53 |
palette_colors = list(color_palettes.values())
|
54 |
|
55 |
+
palette_name = vis.selectbox("Color sequence", options=palette_names, index=22)
|
|
|
|
|
|
|
56 |
|
57 |
+
color_sequence = color_palettes[palette_name] # type: ignore
|
58 |
|
59 |
DATA_DIR = Path("mlip_arena/tasks/diatomics")
|
60 |
+
if not mlip_methods and not dft_methods:
|
61 |
st.stop()
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
+
dfs = [
|
64 |
+
pd.read_json(DATA_DIR / REGISTRY[method]["family"] / "homonuclear-diatomics.json")
|
65 |
+
for method in mlip_methods
|
66 |
+
]
|
67 |
+
dfs.extend(
|
68 |
+
[
|
69 |
+
pd.read_json(DATA_DIR / method.lower() / "homonuclear-diatomics.json")
|
70 |
+
for method in dft_methods
|
71 |
+
]
|
72 |
+
)
|
73 |
df = pd.concat(dfs, ignore_index=True)
|
74 |
df.drop_duplicates(inplace=True, subset=["name", "method"])
|
75 |
|
76 |
+
method_color_mapping = {
|
77 |
+
method: color_sequence[i % len(color_sequence)]
|
78 |
+
for i, method in enumerate(df["method"].unique())
|
79 |
+
}
|
80 |
|
81 |
# img_dir = Path('./images')
|
82 |
# img_dir.mkdir(exist_ok=True)
|
83 |
|
84 |
for i, symbol in enumerate(chemical_symbols[1:]):
|
|
|
85 |
if i % ncols == 0:
|
86 |
cols = st.columns(ncols)
|
87 |
|
|
|
95 |
elo, flo = float("inf"), float("inf")
|
96 |
|
97 |
for j, method in enumerate(rows["method"].unique()):
|
98 |
+
if method not in mlip_methods and method not in dft_methods:
|
99 |
+
continue
|
100 |
row = rows[rows["method"] == method].iloc[0]
|
101 |
|
102 |
rs = np.array(row["R"])
|
|
|
119 |
fs = fs[ind]
|
120 |
|
121 |
if "GPAW" in method:
|
122 |
+
xs = np.linspace(rs.min() * 0.99, rs.max() * 1.01, int(5e2))
|
123 |
else:
|
124 |
xs = rs
|
125 |
|
|
|
130 |
else:
|
131 |
ys = es
|
132 |
|
133 |
+
elo = min(elo, max(ys.min() * 1.2, -15), -1)
|
134 |
|
135 |
fig.add_trace(
|
136 |
go.Scatter(
|
137 |
+
x=xs,
|
138 |
+
y=ys,
|
139 |
mode="lines",
|
140 |
line=dict(
|
141 |
color=method_color_mapping[method],
|
|
|
149 |
if force_plot and "GPAW" not in method:
|
150 |
ys = fs
|
151 |
|
152 |
+
flo = min(flo, max(ys.min() * 1.2, -50))
|
153 |
|
154 |
fig.add_trace(
|
155 |
go.Scatter(
|
156 |
+
x=xs,
|
157 |
+
y=ys,
|
158 |
mode="lines",
|
159 |
line=dict(
|
160 |
color=method_color_mapping[method],
|
|
|
180 |
|
181 |
# Set y-axes titles
|
182 |
if energy_plot:
|
|
|
183 |
fig.update_layout(
|
184 |
yaxis=dict(
|
185 |
title=dict(text="Energy [eV]"),
|
186 |
side="left",
|
187 |
+
range=[elo, 1.5 * (abs(elo))],
|
188 |
)
|
189 |
)
|
190 |
|
191 |
if force_plot:
|
|
|
192 |
fig.update_layout(
|
193 |
yaxis2=dict(
|
194 |
title=dict(text="Force [eV/Å]"),
|
195 |
side="right",
|
196 |
+
range=[flo, 1.0 * abs(flo)],
|
197 |
overlaying="y",
|
198 |
tickmode="sync",
|
199 |
),
|