Spaces:
Running
Running
Yuan (Cyrus) Chiang
commited on
Add ANI2x (#48)
Browse files* add ani and first successful calculator; still unable to change device
* add torch ani diatomic curves
* update readme about lfs
* reformat legend
.github/README.md
CHANGED
@@ -88,6 +88,8 @@ MLIP Arena is now in pre-alpha. If you're interested in joining the effort, plea
|
|
88 |
### Development
|
89 |
|
90 |
```
|
|
|
|
|
91 |
streamlit run serve/app.py
|
92 |
```
|
93 |
|
|
|
88 |
### Development
|
89 |
|
90 |
```
|
91 |
+
git lfs fetch --all
|
92 |
+
git lfs pull
|
93 |
streamlit run serve/app.py
|
94 |
```
|
95 |
|
mlip_arena/models/externals/ani.py
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
|
3 |
+
import yaml
|
4 |
+
from pathlib import Path
|
5 |
+
|
6 |
+
from ase.calculators.calculator import all_changes
|
7 |
+
from torchani.ase import Calculator as ANICalculator
|
8 |
+
from torchani.models import BuiltinEnsemble
|
9 |
+
|
10 |
+
from mlip_arena.models.utils import get_freer_device
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
with open(Path(__file__).parents[1] / "registry.yaml", encoding="utf-8") as f:
|
15 |
+
REGISTRY = yaml.safe_load(f)
|
16 |
+
|
17 |
+
|
18 |
+
class ANI2x(ANICalculator):
|
19 |
+
def __init__(
|
20 |
+
self,
|
21 |
+
checkpoint=REGISTRY["ANI2x"]["checkpoint"],
|
22 |
+
device: str | None = None,
|
23 |
+
periodic_table_index=False,
|
24 |
+
**kwargs,
|
25 |
+
):
|
26 |
+
self.device = device or str(get_freer_device())
|
27 |
+
|
28 |
+
ensemble = BuiltinEnsemble._from_neurochem_resources(
|
29 |
+
checkpoint, periodic_table_index
|
30 |
+
)
|
31 |
+
# TODO: ANICalculator does not offer API to change device
|
32 |
+
# ensemble.species.device = self.device
|
33 |
+
super().__init__(ensemble.species, ensemble, **kwargs)
|
34 |
+
|
35 |
+
|
36 |
+
def calculate(
|
37 |
+
self, atoms=None, properties=['energy', 'forces', 'stress'], system_changes=all_changes
|
38 |
+
):
|
39 |
+
super().calculate(atoms, properties, system_changes)
|
mlip_arena/models/registry.yaml
CHANGED
@@ -93,25 +93,27 @@ MatterSim:
|
|
93 |
npt: true
|
94 |
license: MIT
|
95 |
|
96 |
-
|
97 |
module: externals
|
98 |
-
class:
|
99 |
family: orb
|
100 |
-
package: orb-models==0.
|
101 |
-
checkpoint:
|
102 |
-
username:
|
103 |
-
last-update: 2024-
|
104 |
-
datetime: 2024-
|
105 |
datasets:
|
106 |
-
- MPTrj
|
107 |
- Alexandria
|
|
|
|
|
108 |
gpu-tasks:
|
109 |
- homonuclear-diatomics
|
110 |
- combustion
|
111 |
- stability
|
112 |
github: https://github.com/orbital-materials/orb-models
|
113 |
doi:
|
114 |
-
date: 2024-
|
115 |
prediction: EFS
|
116 |
nvt: true
|
117 |
npt: true
|
@@ -252,6 +254,27 @@ MACE-OFF(M):
|
|
252 |
npt: true
|
253 |
license: ASL
|
254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
ALIGNN:
|
256 |
module: externals
|
257 |
class: ALIGNN
|
@@ -294,27 +317,25 @@ DeepMD:
|
|
294 |
npt: true
|
295 |
license:
|
296 |
|
297 |
-
|
298 |
module: externals
|
299 |
-
class:
|
300 |
family: orb
|
301 |
-
package: orb-models==0.
|
302 |
-
checkpoint:
|
303 |
-
username:
|
304 |
-
last-update: 2024-
|
305 |
-
datetime: 2024-
|
306 |
datasets:
|
307 |
-
- MPTrj
|
308 |
- Alexandria
|
309 |
-
cpu-tasks:
|
310 |
-
- eos_alloy
|
311 |
gpu-tasks:
|
312 |
- homonuclear-diatomics
|
313 |
- combustion
|
314 |
- stability
|
315 |
github: https://github.com/orbital-materials/orb-models
|
316 |
doi:
|
317 |
-
date: 2024-
|
318 |
prediction: EFS
|
319 |
nvt: true
|
320 |
npt: true
|
|
|
93 |
npt: true
|
94 |
license: MIT
|
95 |
|
96 |
+
ORBv2:
|
97 |
module: externals
|
98 |
+
class: ORBv2
|
99 |
family: orb
|
100 |
+
package: orb-models==0.4.0
|
101 |
+
checkpoint: orb-v2-20241011.ckpt
|
102 |
+
username:
|
103 |
+
last-update: 2024-10-29T00:00:00
|
104 |
+
datetime: 2024-10-29T00:00:00 # TODO: Fake datetime
|
105 |
datasets:
|
106 |
+
- MPTrj
|
107 |
- Alexandria
|
108 |
+
cpu-tasks:
|
109 |
+
- eos_alloy
|
110 |
gpu-tasks:
|
111 |
- homonuclear-diatomics
|
112 |
- combustion
|
113 |
- stability
|
114 |
github: https://github.com/orbital-materials/orb-models
|
115 |
doi:
|
116 |
+
date: 2024-10-15
|
117 |
prediction: EFS
|
118 |
nvt: true
|
119 |
npt: true
|
|
|
254 |
npt: true
|
255 |
license: ASL
|
256 |
|
257 |
+
ANI2x:
|
258 |
+
module: externals
|
259 |
+
class: ANI2x
|
260 |
+
family: ani
|
261 |
+
package: torchani==2.2.4
|
262 |
+
checkpoint: ani-2x_8x.info
|
263 |
+
username: cyrusyc
|
264 |
+
last-update: 2024-12-11T16:00:00
|
265 |
+
datetime: 2024-12-11T16:00:00 # TODO: Fake datetime
|
266 |
+
datasets:
|
267 |
+
cpu-tasks:
|
268 |
+
gpu-tasks:
|
269 |
+
- homonuclear-diatomics
|
270 |
+
github: https://github.com/aiqm/torchani
|
271 |
+
doi: https://www.nature.com/articles/s41598-024-62242-5
|
272 |
+
date: 2024-05-23
|
273 |
+
prediction: EFS
|
274 |
+
nvt: true
|
275 |
+
npt: false
|
276 |
+
license: MIT
|
277 |
+
|
278 |
ALIGNN:
|
279 |
module: externals
|
280 |
class: ALIGNN
|
|
|
317 |
npt: true
|
318 |
license:
|
319 |
|
320 |
+
ORB:
|
321 |
module: externals
|
322 |
+
class: ORB
|
323 |
family: orb
|
324 |
+
package: orb-models==0.3.1
|
325 |
+
checkpoint: orbff-v1-20240827.ckpt
|
326 |
+
username: cyrusyc
|
327 |
+
last-update: 2024-03-25T14:30:00
|
328 |
+
datetime: 2024-03-25T14:30:00 # TODO: Fake datetime
|
329 |
datasets:
|
330 |
+
- MPTrj # TODO: fake HF dataset repo
|
331 |
- Alexandria
|
|
|
|
|
332 |
gpu-tasks:
|
333 |
- homonuclear-diatomics
|
334 |
- combustion
|
335 |
- stability
|
336 |
github: https://github.com/orbital-materials/orb-models
|
337 |
doi:
|
338 |
+
date: 2024-09-03
|
339 |
prediction: EFS
|
340 |
nvt: true
|
341 |
npt: true
|
mlip_arena/tasks/diatomics/ani/homonuclear-diatomics.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pyproject.toml
CHANGED
@@ -59,6 +59,7 @@ test = [
|
|
59 |
"pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168",
|
60 |
"alignn==2024.5.27",
|
61 |
"mattersim==1.0.0rc9",
|
|
|
62 |
"pytest",
|
63 |
"pytest-xdist",
|
64 |
"prefect==3.1.11",
|
|
|
59 |
"pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168",
|
60 |
"alignn==2024.5.27",
|
61 |
"mattersim==1.0.0rc9",
|
62 |
+
"torchani==2.2.4",
|
63 |
"pytest",
|
64 |
"pytest-xdist",
|
65 |
"prefect==3.1.11",
|
serve/tasks/homonuclear-diatomics.py
CHANGED
@@ -30,7 +30,7 @@ valid_models = [
|
|
30 |
mlip_methods = container.multiselect(
|
31 |
"MLIPs",
|
32 |
valid_models,
|
33 |
-
["MACE-MP(M)", "CHGNet", "M3GNet", "MatterSim", "SevenNet", "ORBv2", "eqV2(OMat)"],
|
34 |
)
|
35 |
dft_methods = container.multiselect("DFT Methods", ["PBE"], ["PBE"])
|
36 |
|
@@ -228,15 +228,15 @@ def get_plots(df, energy_plot: bool, force_plot: bool, method_color_mapping: dic
|
|
228 |
fig.update_layout(
|
229 |
showlegend=True,
|
230 |
legend=dict(
|
231 |
-
orientation="
|
232 |
-
x=0
|
233 |
xanchor="right",
|
234 |
y=1,
|
235 |
yanchor="top",
|
236 |
bgcolor="rgba(0, 0, 0, 0)",
|
237 |
# traceorder='reversed',
|
238 |
-
|
239 |
-
|
240 |
),
|
241 |
title_text=f"{name}",
|
242 |
title_x=0.5,
|
|
|
30 |
mlip_methods = container.multiselect(
|
31 |
"MLIPs",
|
32 |
valid_models,
|
33 |
+
["MACE-MP(M)", "CHGNet", "M3GNet", "MatterSim", "SevenNet", "ORBv2", "eqV2(OMat)", "ANI2x"],
|
34 |
)
|
35 |
dft_methods = container.multiselect("DFT Methods", ["PBE"], ["PBE"])
|
36 |
|
|
|
228 |
fig.update_layout(
|
229 |
showlegend=True,
|
230 |
legend=dict(
|
231 |
+
orientation="h",
|
232 |
+
x=1.0,
|
233 |
xanchor="right",
|
234 |
y=1,
|
235 |
yanchor="top",
|
236 |
bgcolor="rgba(0, 0, 0, 0)",
|
237 |
# traceorder='reversed',
|
238 |
+
entrywidth=0.4,
|
239 |
+
entrywidthmode="fraction",
|
240 |
),
|
241 |
title_text=f"{name}",
|
242 |
title_x=0.5,
|