Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torchani models (prebuild only) #163

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion ipsuite/models/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@ from .ensemble import EnsembleModel
from .gap import GAP
from .mace_model import MACE
from .nequip import Nequip
from .torchani import TorchAni

__all__ = ["MLModel", "EnsembleModel", "GAP", "Nequip", "MACE", "Apax", "ApaxEnsemble"]
__all__ = [
"MLModel",
"EnsembleModel",
"GAP",
"Nequip",
"MACE",
"Apax",
"ApaxEnsemble",
"TorchAni",
]
23 changes: 23 additions & 0 deletions ipsuite/models/torchani.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import ase.calculators.calculator
import torchani
import zntrack

from ipsuite.models import MLModel

_models = {
"ANI2x": torchani.models.ANI2x,
"ANI1ccx": torchani.models.ANI1ccx,
"ANI1x": torchani.models.ANI1x,
}


class TorchAni(MLModel):
"""TorchAni model implementation."""

model_name: str = zntrack.zn.params("ANI2x")

def run(self) -> None:
pass

def get_calculator(self, **kwargs) -> ase.calculators.calculator.Calculator:
return _models[self.model_name].ase()
Loading