Skip to content

Commit cc75638

Browse files
authored
add aceff-2.0 (#111)
* add aceff-2.0 * update userguide * Update userguide.md
1 parent e42012f commit cc75638

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

doc/userguide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Pretrained and your own local models are supported.
198198
| ---- | ----- |
199199
| `aceff-1.0` | Pretrained [AceFF-1.0](https://huggingface.co/Acellera/AceFF-1.0) [TensorNet](https://doi.org/10.48550/arXiv.2306.06482) model. |
200200
| `aceff-1.1` | Pretrained [AceFF-1.1](https://huggingface.co/Acellera/AceFF-1.0) [TensorNet](https://doi.org/10.48550/arXiv.2306.06482) model. |
201+
| `aceff-2.0` | Pretrained [AceFF-2.0](https://huggingface.co/Acellera/AceFF-2.0) [TensorNet2](https://arxiv.org/abs/2601.00581) model. |
201202
| `torchmdnet` | Custom TorchMD-Net models specified with the `modelPath` argument. |
202203

203204

@@ -229,4 +230,4 @@ OpenMM-ML is based on a plugin architecture, allowing other packages to provide
229230
packages listed above are the ones for which OpenMM-ML has built in support. Other packages can interface to it by
230231
defining two classes that subclass `MLPotentialImpl` and `MLPotentialImplFactory`, then registering them by specifying
231232
an [entry point](https://packaging.python.org/en/latest/specifications/entry-points/) in the group `openmmml.potentials`.
232-
Consult the documentation for other packages to see whether they provide interfaces for OpenMM-ML.
233+
Consult the documentation for other packages to see whether they provide interfaces for OpenMM-ML.

openmmml/models/torchmdnetpotential.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ class TorchMDNetPotentialImpl(MLPotentialImpl):
7373
7474
Pretained AceFF models can be used directly:
7575
76-
>>> potential = MLPotential('aceff-1.0')
76+
>>> potential = MLPotential('aceff-2.0')
7777
7878
>>> potential = MLPotential('aceff-1.1')
7979
80+
>>> potential = MLPotential('aceff-1.0')
81+
8082
"""
8183

8284
def __init__(self,
@@ -144,6 +146,9 @@ def addForces(self,
144146
elif self.name == 'aceff-1.1':
145147
repo_id="Acellera/AceFF-1.1"
146148
filename="aceff_v1.1.ckpt"
149+
elif self.name == 'aceff-2.0':
150+
repo_id="Acellera/AceFF-2.0"
151+
filename="aceff_v2.0.ckpt"
147152
else:
148153
raise ValueError(f'Model name {self.name} does not exist.')
149154

@@ -170,7 +175,11 @@ def addForces(self,
170175
batch = torch.tensor(batch, dtype=torch.long)
171176

172177
# TensorNet models can use CUDA graphs and the default is to use them.
173-
use_cudagraphs = args.get('cudaGraphs', True if isinstance(model.representation_model, torchmdnet.models.tensornet.TensorNet) else False)
178+
use_cudagraphs = args.get('cudaGraphs',
179+
True if (isinstance(model.representation_model, torchmdnet.models.tensornet.TensorNet)
180+
or isinstance(model.representation_model, torchmdnet.models.tensornet2.TensorNet2))
181+
else False
182+
)
174183

175184
class TorchMDNetForce(torch.nn.Module):
176185
def __init__(self, model, numbers, charge, atoms, batch, lengthScale, energyScale):

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
'torchmdnet = openmmml.models.torchmdnetpotential:TorchMDNetPotentialImplFactory',
5858
'aceff-1.0 = openmmml.models.torchmdnetpotential:TorchMDNetPotentialImplFactory',
5959
'aceff-1.1 = openmmml.models.torchmdnetpotential:TorchMDNetPotentialImplFactory',
60+
'aceff-2.0 = openmmml.models.torchmdnetpotential:TorchMDNetPotentialImplFactory',
6061
]
6162
}
6263
)

0 commit comments

Comments
 (0)