Adding New Models¶
How to add a new model to TorchSim¶
We welcome the addition of new models to torch_sim. We want
easy batched simulations to be available to the whole community
of MLIP developers and users.
Open a PR or an issue to get feedback. We are happy to take a look, even if you haven’t finished your implementation yet.
Create a new model file in
torch_sim/models. It should inherit fromtorch_sim.models.interface.ModelInterfaceandtorch.nn.module.Add
torch_sim.models.tests.make_validate_model_outputs_testandtorch_sim.models.tests.make_model_calculator_consistency_testas models tests. See any of the other model tests for examples.Update
test.ymlto include proper installation and testing of the relevant model.Pull the model import up to
torch_sim.modelsby adding import totorch_sim.models.__init__.pyin try except clause.Update
docs/conf.pyto include model inautodoc_mock_imports = [...]
Optional¶
Write a tutorial or example showing off your model.
Update the
.github/workflows/docs.ymlto ensure your model is being correctly included in the documentation.
We are also happy for developers to implement model interfaces in their own codebases. Steps 1 & 2 should still be followed to ensure the model implementation is compatible with the rest of TorchSim.