/atomistic-skills:ml-matgl-finetunefrom Atomistic Skills
Fine-tunes MatGL machine learning interatomic potentials (CHGNet, TensorNet) on custom datasets for specific chemical systems or physical properties using PyTorch Lightning.
Ships in Atomistic Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
To evaluate and improve the accuracy of a foundation MatGL potential (e.g., CHGNet, TensorNet) for a specific chemical system or physical property using the provided Python fine-tuning script.
/benchmark-finetuning workflow for details.scripts/prepare_matgl_data.py to process JSON structures and split into training and validation sets.scripts/train_matgl.py to begin fine-tuning natively on the GPU using PyTorch Lightning.register_model tool to register the newly fine-tuned model checkpoint into the local registry so future research tasks can discover and reuse it.Convert your dataset into the appropriate JSON format for MatGL training:
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/scripts/prepare_matgl_data.py \
--data /path/to/training_data.json \
--model CHGNet-PES-MatPES-PBE-1M-2026.9 \
--val-split 0.1 \
--output-dir ./matgl_finetuned
Fine-tune the model using the prepared data:
${CLAUDE_SKILL_DIR}/../../venv/run mlip python ${CLAUDE_SKILL_DIR}/scripts/train_matgl.py \
--train-data ./matgl_finetuned/train_data.json \
--val-data ./matgl_finetuned/val_data.json \
--model CHGNet-PES-MatPES-PBE-1M-2026.9 \
--epochs 10 \
--lr 1e-3 \
--batch-size 4 \
--freeze-backbone \
--output-dir ./matgl_finetuned
MatGL fine-tuning is divided into a data preparation step (formatting nested dictionaries and converting lists) and a native training run utilizing PyTorch Lightning.
prepare_matgl_data.py)| Key | Type | Default | Description |
|---|---|---|---|
--data | str | (Required) | Path to JSON file containing ASE/pymatgen structure dictionaries |
--model | str | CHGNet-PES-MatPES-PBE-1M-2026.9 | Base model name or path to a checkpoint |
--output-dir | str | ./fine_tuning | Directory to save the processed data |
--val-split | float | 0.1 | Fraction of data to set aside for validation |
--seed | int | 42 | Random seed for splitting validation data |
--vasp-stress-conversion | flag | - | If set, multiplies stress values by -1/160.2x to convert VASP raw kB to eV/ų |
train_matgl.py)| Key | Type | Default | Description |
|---|---|---|---|
--train-data | str | (Required) | Path to JSON file containing training data |
--val-data | str | None | Path to JSON file containing validation data (optional) |
--model | str | CHGNet-PES-MatPES-PBE-1M-2026.9 | Base model name or path to a checkpoint |
--epochs | int | 10 | Number of training epochs |
--lr | float | 1e-3 | Learning rate |
--batch-size | int | 4 | Training batch size |
--device | str | auto | Target compute device (cuda or cpu) |
--output-dir | str | ./fine_tuning | Directory to save the fine-tuned model and logs |
--freeze-backbone | flag | - | Freeze backbone (interaction blocks); only readout heads are trained |
--reinit-head | flag | - | Re-initialize readout head weights |
--scheduler | str | CosineAnnealingLR | CosineAnnealingLR or ReduceLROnPlateau |
--patience | int | None | Early stopping patience (epochs) |
--energy-weight | float | 1.0 | Loss weight for energy |
--force-weight | float | 1.0 | Loss weight for forces |
--stress-weight | float | 0.1 | Loss weight for stress |
--freeze-backbone is strongly recommended to prevent catastrophic forgetting.element_refs): If your fine-tuning data is computed using the same DFT functional (e.g., PBE) as the foundation model's original training data, you should reuse the foundation model's original isolated atom reference energies instead of re-fitting them. This maintains thermodynamic compatibility across the periodic table.mlip environment (venv/run mlip ...). MatGL >= 4 uses PyTorch Geometric only; there is no DGL backend.eV/ų. Raw VASP stress obtained directly via some JSON files may be in kilo-Bar (kB). The Atomate2 MCP tool handles this conversion automatically when convert_units=True. However, if your JSON labels contain raw kB stress, you MUST pass the --vasp-stress-conversion flag to scripts/prepare_matgl_data.py to automatically scale them by -1/160.2x. For more details on unit standardization, see @[skills/general-property-units/SKILL.md].Author: Bowen Deng Contact: GitHub @learningmatter-mit
examples/matgl-wbm-finetune/README.md (opens in a new tab)examples/matgl-wbm-finetune/checkpoint_roundtrip.json (opens in a new tab)examples/matgl-wbm-finetune/finetune_record.json (opens in a new tab)examples/matgl-wbm-finetune/training_history.json (opens in a new tab)examples/matgl-wbm-finetune/training_history.png (opens in a new tab)examples/matgl-wbm-finetune/verify_checkpoint.py (opens in a new tab)scripts/generate_matgl_config.py (opens in a new tab)scripts/prepare_matgl_data.py (opens in a new tab)scripts/train_matgl.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub learningmatter-mit/atomisticskills --plugin atomistic-skills133 skills in this plugin
/chem-bond-dissociationCalculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation./chem-conformer-searchGenerate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting./chem-db-mofQuery multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al. via Materials Cloud) and download CIF structures with optional element or identifier filters.Other plugins' skills for the same job