Skip to main content

Equitrain: Training and Fine-Tuning Machine Learning Interatomic Potentials

Equitrain is a Python toolkit for preprocessing atomistic datasets, training machine-learning interatomic potentials (MLIPs), fine-tuning existing checkpoints, and running evaluation or prediction through one CLI/API.

Features

  • Unified Torch and JAX training entry points.
  • Model wrappers for MACE, SevenNet, ORB, ANI, and M3GNet.
  • Native HDF5 preprocessing for large atomistic datasets.
  • Torch reaction-relative losses for barrier and reaction energies.
  • Fine-tuning adapters for Delta/L2-SP, Freeze, and LoRA workflows.
  • ASE calculator helpers for batched prediction and relaxation.

Supported Models

Wrapper Backends Upstream / Companion Project Notes
mace Torch, JAX mace-model Companion repository for MACE model definitions, conversion, and foundation-model export.
sevennet Torch MDIL-SNU/SevenNet Torch SevenNet checkpoints and models.
orb Torch orbital-materials/orb-models Torch ORB force-field models.
ani Torch, JAX aiqm/torchani Torch uses TorchANI; JAX uses a JAX-native bundle.
m3gnet Torch, JAX materialsvirtuallab/matgl Torch uses MatGL; JAX uses a JAX-native bundle.

For MACE, use mace-model for model construction/conversion and equitrain for preprocessing, training, fine-tuning, checkpointing, evaluation, and prediction.

Documentation

Full documentation is published at https://bamescience.github.io/equitrain/:

The documentation source is in docs/. Build or serve it locally with:

pip install -e '.[docu]'
mkdocs serve

Installation

pip install equitrain

Until the package is fully available on PyPI, install from a local clone:

git clone https://github.com/BAMeScience/equitrain.git
cd equitrain
python3.10 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install uv
uv pip install -e '.[dev,docu]'

Install model/runtime extras as needed:

pip install 'equitrain[torch,mace]'
pip install 'equitrain[jax,mace-jax]'
pip install 'equitrain[torch,ani]'

Minimal Workflow

Preprocess data:

equitrain-preprocess \
    --train-file data-train.xyz \
    --valid-file data-valid.xyz \
    --compute-statistics \
    --atomic-energies average \
    --output-dir data \
    --r-max 4.5

Train a Torch/MACE model:

equitrain -v \
    --train-file data/train.h5 \
    --valid-file data/valid.h5 \
    --output-dir runs/mace \
    --model path/to/mace.model \
    --model-wrapper mace \
    --epochs 10 \
    --tqdm

Evaluate and predict:

equitrain-evaluate -v \
    --test-file data/test.h5 \
    --model path/to/mace.model \
    --model-wrapper mace \
    --output-dir evaluation_mace

equitrain-predict \
    --predict-file data/valid.h5 \
    --model path/to/mace.model \
    --model-wrapper mace \
    --output-dir predictions_mace

See the Quickstart for the full workflow, including JAX bundles and fine-tuned checkpoint export.

Fine-Tuning Note

Equitrain's Delta adapter is a residual-parameter implementation of L2-SP ("Starting Point") regularization from Li, Grandvalet, and Davoine, 2018, Explicit Inductive Bias for Transfer Learning with Convolutional Networks. It parameterizes fine-tuning as theta = theta_0 + delta, so weight decay on trainable deltas regularizes ||delta||_2^2.

Delta combined with freeze_layers is targeted L2-SP (L2-TSP): the L2-SP penalty applies only to selected trainable delta layers while frozen layers remain exactly at their pre-trained starting values. See Fine-Tuning.

Resources

Example data-preparation scripts are in resources/data, training scripts are in resources/training, and initial model examples are in resources/models.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

equitrain-1.0.0.tar.gz (440.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

equitrain-1.0.0-py3-none-any.whl (191.2 kB view details)

Uploaded Python 3

File details

Details for the file equitrain-1.0.0.tar.gz.

File metadata

  • Download URL: equitrain-1.0.0.tar.gz
  • Upload date:
  • Size: 440.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for equitrain-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5bb366c587a2a98741a3caf0b9076406780df041634d78b24953d45c94ce7cbd
MD5 06a91e6fae5447c9e84562e91bc03e3c
BLAKE2b-256 653880588ae54bfff15e85e5493fecb78c39f77f44df0c4c3ab42b0cd23d7006

See more details on using hashes here.

Provenance

The following attestation bundles were made for equitrain-1.0.0.tar.gz:

Publisher: publish.yml on BAMeScience/equitrain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file equitrain-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: equitrain-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 191.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for equitrain-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca9007f3018ec941fb47ce7049a0e480ab184c9da8d52ae543732b1be0233b8a
MD5 8d8a9250c210e8e1afc63cb6c90947ec
BLAKE2b-256 bb414c6da5c90978ea91bed5bad8da90cc3162ab41c9a8ed129a986f8ead3262

See more details on using hashes here.

Provenance

The following attestation bundles were made for equitrain-1.0.0-py3-none-any.whl:

Publisher: publish.yml on BAMeScience/equitrain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page