Skip to content
cccskills
FreePublished on GitHub

deepmd-train

Train DeePMD-kit machine learning potentials. Covers DPA-3 (recommended), se_e2_a (legacy), and fine-tuning from pretrained models.

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208 stars(GitHub 208 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md4.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

DeePMD Training

When to Use

  • User wants to train a machine learning interatomic potential
  • User has DFT data (energies, forces, stresses) and wants a DP model
  • User wants to fine-tune a pretrained DPA-3 model

Prerequisites

  1. Training data in DeePMD format (use data/dpdata/SKILL.md to convert from VASP/QE)
  2. GPU node available on HPC
  3. deepmd-kit installed (dp --version)

Data Directory Structure

data/
├── train/
│   ├── set.000/
│   │   ├── coord.npy       # Atomic coordinates (natoms*3,)
│   │   ├── energy.npy      # Total energy (1,)
│   │   ├── force.npy       # Forces (natoms*3,)
│   │   ├── box.npy         # Cell vectors (9,)
│   │   └── virial.npy      # Stress tensor (optional, 9,)
│   └── type.raw            # Atom type indices
└── valid/
    └── set.000/
        └── ...

Workflow Steps

1. Create workflow

catgo_workflow_engine(action="create", params={"name": "DeePMD DPA-3 training"})

2. Add training task

catgo_workflow_engine(action="add_task", params={
  "workflow_id": "wf_xxx",
  "task_type": "shell",
  "name": "dp_train",
  "command": "dp train input.json 2>&1 | tee train.log",
  "input_files": {
    "input.json": "<training config>"
  },
  "system_name": "dp_model"
})

3. Add freeze step (convert to production model)

catgo_workflow_engine(action="add_task", params={
  "workflow_id": "wf_xxx",
  "task_type": "shell",
  "name": "dp_freeze",
  "command": "dp freeze -o frozen_model.pb",
  "depends_on": ["dp_train"],
  "system_name": "dp_model"
})

DPA-3 Training Config (Recommended)

{
  "model": {
    "type_map": ["Ti", "O"],
    "descriptor": {
      "type": "dpa3",
      "rcut": 6.0,
      "rcut_smth": 0.5,
      "sel": "auto",
      "neuron": [25, 50, 100],
      "n_interaction": 3,
      "n_head": 4
    },
    "fitting_net": {
      "type": "ener",
      "neuron": [240, 240, 240]
    }
  },
  "training": {
    "training_data": {
      "systems": ["./data/train"],
      "batch_size": "auto"
    },
    "validation_data": {
      "systems": ["./data/valid"],
      "batch_size": "auto"
    },
    "numb_steps": 1000000,
    "disp_freq": 1000,
    "save_freq": 10000
  },
  "learning_rate": {
    "type": "exp",
    "start_lr": 1e-3,
    "stop_lr": 1e-8,
    "decay_steps": 5000
  },
  "loss": {
    "type": "ener",
    "start_pref_e": 0.02,
    "limit_pref_e": 1.0,
    "start_pref_f": 1000,
    "limit_pref_f": 1.0,
    "start_pref_v": 0.0,
    "limit_pref_v": 0.0
  }
}

se_e2_a Training Config (Legacy)

Replace the descriptor block:

"descriptor": {
  "type": "se_e2_a",
  "rcut": 6.0,
  "rcut_smth": 0.5,
  "sel": [46, 92],
  "neuron": [25, 50, 100],
  "axis_neuron": 16
}

sel must list the max neighbor count per element type. Use dp neighbor-stat to determine.

Fine-Tuning from Pretrained Model

# Download pretrained model (e.g., from AIS Square)
# Then fine-tune:
dp train input.json --finetune pretrained.pb 2>&1 | tee finetune.log

Reduce numb_steps to 100000-200000 and start_lr to 1e-4 for fine-tuning.

Parameter Guidance

ParameterTypical valueNotes
rcut6.0-9.0 AInteraction cutoff; larger = more accurate but slower
selauto or [N1, N2]Max neighbors per type; use dp neighbor-stat
numb_steps500K-2MMore data needs more steps
start_lr1e-3Learning rate; reduce for fine-tuning
batch_sizeautoLet DeePMD choose based on system size
start_pref_f1000Force weight starts high, decays to limit_pref_f

Common Pitfalls

  1. Insufficient training data — need at least 1000-5000 frames for a reliable model. More diverse configs = better.
  2. sel too small — if max neighbors exceeds sel, training crashes. Always run dp neighbor-stat first.
  3. Overfitting — monitor validation loss. If train loss drops but valid loss plateaus, stop training or add more data.
  4. Missing virial — if training data has no stress tensor, set start_pref_v = 0, limit_pref_v = 0.
  5. Mixed element sets — type_map must be consistent across all training systems and inference.
  6. Forgetting to freeze — the checkpoint directory is not the production model. Run dp freeze to create a portable .pb file.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

abinit

Free

Generate and manage ABINIT DFT calculations. Use when the user requests ABINIT, or needs DFPT phonons, GW calculations, or BSE optical spectra.

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208Updated Oct 23, 2026

Use when the user asks to place an adsorbate molecule on a surface, find adsorption sites, or set up a surface+adsorbate model for DFT.

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208Updated Oct 23, 2026

Use when the user asks for adsorption energy, binding energy, or wants to compare how strongly a molecule binds to a surface.

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208Updated Oct 23, 2026

Use when the user asks to analyze computational results: Gibbs free energy, OER/HER/CO2RR overpotentials, adsorption energy, convergence tests, DOS/d-band analysis, or Bader charge analysis.

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208Updated Oct 23, 2026

Use AmberTools antechamber for molecular force field parameterization. Generates GAFF/GAFF2 parameters and AM1-BCC or RESP charges for use in AMBER or LAMMPS classical MD simulations.

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208Updated Oct 23, 2026

One-shot recipes for adding, deleting, moving, and replacing individual atoms in the active CatGo viewer structure. Use whenever the user asks to "add an atom", "delete atoms", "remove this atom", "move atom N", "replace H with Li", or any single-atom edit — including "add a hydrogen on top of atom 12" / "delete atoms 5–9" / "swap the oxygen at site 3 for fluorine". Skips the discovery loop (no need to list structure tools or check adsorption sites first); goes straight to the matching `catgo_structure` action. Triggers in Chinese on 加原子, 删原子, 减原子, 移动原子, 替换原子, 增加氢, 删除氧, 把 ... 换成 ....

The English summary is being prepared. Showing the original description.

Hello-QM/catgo-LRG208Updated Oct 23, 2026

See all skills by Hello-QM

Report a problem with this skill