Training and evaluating machine learning models for atomistic systems.
Project description
metatrain is a command line interface (CLI) to train and evaluate atomistic
models of various architectures. It features a common yaml option inputs to configure
training and evaluation. Trained models are exported as standalone files that can be
used directly in various molecular dynamics (MD) engines (e.g. LAMMPS, i-PI, ASE
...) using the metatomic interface.
The idea behind metatrain is to have a general hub that provides a homogeneous
environment and user interface, transforming every ML architecture into an end-to-end
model that can be connected to an MD engine. Any custom architecture compatible with
TorchScript can be integrated into
metatrain, gaining automatic access to a training and evaluation interface, as well as
compatibility with various MD engines.
Note:
metatraindoes not provide mathematical functionalities per se, but relies on external models that implement the various architectures.
List of Implemented Architectures
Currently metatrain supports the following architectures for building an atomistic
model:
| Name | Description |
|---|---|
| GAP | Sparse Gaussian Approximation Potential (GAP) using Smooth Overlap of Atomic Positions (SOAP). |
| PET | Point Edge Transformer (PET), interatomic machine learning potential |
| NanoPET (experimental) | Re-implementation of the original PET with slightly improved training and evaluation speed |
| PET (deprecated) | Original implementation of the PET model used for prototyping, now deprecated in favor of the native metatrain PET implementation. |
| SOAP BPNN | A Behler-Parrinello neural network with SOAP features |
Documentation
For details, tutorials, and examples, please visit our documentation.
Installation
Install metatrain with pip:
pip install metatrain
Install specific models by specifying the model name. For example, to install the SOAP-BPNN model:
pip install metatrain[soap-bpnn]
We also offer a conda installation:
conda install -c conda-forge metatrain
⚠️ The conda installation does not install model-specific dependencies and will only work for architectures without optional dependencies such as NanoPET or PET.
After installation, you can use mtt from the command line to train your models!
Quickstart
To train a model, use the following command:
mtt train options.yaml
Where options.yaml is a configuration file specifying training options. For example, the following configuration trains a SOAP-BPNN model on the QM9 dataset:
# architecture used to train the model
architecture:
name: soap_bpnn
training:
num_epochs: 5 # a very short training run
# Mandatory section defining the parameters for system and target data of the training set
training_set:
systems: "qm9_reduced_100.xyz" # file where the positions are stored
targets:
energy:
key: "U0" # name of the target value
unit: "eV" # unit of the target value
test_set: 0.1 # 10% of the training_set are randomly split for test
validation_set: 0.1 # 10% of the training_set are randomly split for validation
Shell Completion
metatrain comes with completion definitions for its commands for bash and zsh. You
must manually configure your shell to enable completion support.
To make the completions available, source the definitions in your shell’s startup file
(e.g., ~/.bash_profile, ~/.zshrc, or ~/.profile):
source $(mtt --shell-completion)
Having problems or ideas?
Having a problem with metatrain? Please let us know by submitting an issue.
Submit new features or bug fixes through a pull request.
Contributors
Thanks goes to all people who make metatrain possible:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metatrain-2025.9.tar.gz.
File metadata
- Download URL: metatrain-2025.9.tar.gz
- Upload date:
- Size: 550.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f07edc3dd59132bfa116c9c91cbd5ef0e19fc995eafdaa4facfce641406dce2
|
|
| MD5 |
f2c9f0f638753d08451b4521dae50810
|
|
| BLAKE2b-256 |
2e0ccff79de27ea22f64ff311c980d9d877f1066ea5ffc63642a0ac94eb27ab2
|
Provenance
The following attestation bundles were made for metatrain-2025.9.tar.gz:
Publisher:
release.yml on metatensor/metatrain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metatrain-2025.9.tar.gz -
Subject digest:
6f07edc3dd59132bfa116c9c91cbd5ef0e19fc995eafdaa4facfce641406dce2 - Sigstore transparency entry: 405952518
- Sigstore integration time:
-
Permalink:
metatensor/metatrain@c1723897ce8f00f9a6a9d9280ebdc98ff298aa4a -
Branch / Tag:
refs/tags/v2025.9 - Owner: https://github.com/metatensor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c1723897ce8f00f9a6a9d9280ebdc98ff298aa4a -
Trigger Event:
push
-
Statement type:
File details
Details for the file metatrain-2025.9-py3-none-any.whl.
File metadata
- Download URL: metatrain-2025.9-py3-none-any.whl
- Upload date:
- Size: 608.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97d8c89abce419949f6b40b0ad3be8a14b414150fac76dc6c2807d1d8e9a53ee
|
|
| MD5 |
8c5637020b55af9cfa92a61b9607a80c
|
|
| BLAKE2b-256 |
0b24695baa3da71e39dfeaf29a96539c7ba6dac7df915ae1d27fdc550466ac76
|
Provenance
The following attestation bundles were made for metatrain-2025.9-py3-none-any.whl:
Publisher:
release.yml on metatensor/metatrain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metatrain-2025.9-py3-none-any.whl -
Subject digest:
97d8c89abce419949f6b40b0ad3be8a14b414150fac76dc6c2807d1d8e9a53ee - Sigstore transparency entry: 405952539
- Sigstore integration time:
-
Permalink:
metatensor/metatrain@c1723897ce8f00f9a6a9d9280ebdc98ff298aa4a -
Branch / Tag:
refs/tags/v2025.9 - Owner: https://github.com/metatensor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c1723897ce8f00f9a6a9d9280ebdc98ff298aa4a -
Trigger Event:
push
-
Statement type: