$npx -y skills add jinzhezenggroup/computational-chemistry-agent-skills --skill deepmd-trainTrain DeePMD-kit models with progressive disclosure. Use when the user wants to train a DeePMD-kit potential, prepare an input.json, choose between model families such as se_e2_a/DeepPot-SE and DPA3, run dp train, monitor learning curves, freeze checkpoints, or test trained mod
| 1 | # DeePMD-kit Training |
| 2 | |
| 3 | Use this skill to guide DeePMD-kit model training without loading every model-specific recipe up front. |
| 4 | The workflow is intentionally progressive: |
| 5 | |
| 6 | 1. Understand the user's data, target accuracy, compute budget, and deployment backend. |
| 7 | 1. Choose an appropriate model family. |
| 8 | 1. Read only the reference file for the selected model under [`models/`](models/). |
| 9 | 1. Generate or edit `input.json`, run training, monitor, freeze, and test. |
| 10 | |
| 11 | ## Progressive disclosure protocol |
| 12 | |
| 13 | Do not start by reading every model document. First classify the request: |
| 14 | |
| 15 | - If the user already named a model, read only that model reference. |
| 16 | - If the user asks for a recommendation, collect the decision inputs below, choose a model, then read only the selected reference. |
| 17 | - If model-specific parameters are not needed yet, stay in this top-level workflow. |
| 18 | |
| 19 | Available model references: |
| 20 | |
| 21 | | Model reference | Read when | |
| 22 | | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | |
| 23 | | [`models/se-e2-a.md`](models/se-e2-a.md) | The user wants a classical DeepPot-SE baseline, broad compatibility, or a smaller/established production model. | |
| 24 | | [`models/dpa3.md`](models/dpa3.md) | The user wants a high-accuracy DPA3/LAM workflow, large/diverse datasets, dynamic neighbor selection, or pretrained DPA3-style training. | |
| 25 | |
| 26 | ## Model selection |
| 27 | |
| 28 | Ask only for missing information that changes the choice. Prefer reasonable defaults when the answer is obvious from context. |
| 29 | |
| 30 | Key inputs: |
| 31 | |
| 32 | - Data format and size: deepmd/npy, deepmd/hdf5, mixed type, number of systems/frames/elements. |
| 33 | - Target: quick baseline, production accuracy, large atomic model, transfer/fine-tuning, or deployment in MD. |
| 34 | - Compute: CPU/GPU, available memory, single-node vs. distributed training. |
| 35 | - Backend/deployment: PyTorch/TensorFlow/JAX/Paddle training; LAMMPS, Python inference, or other downstream use. |
| 36 | - Labels: energy/force only or also virial/stress. |
| 37 | - System diversity: single chemistry/phase vs. diverse multi-domain datasets. |
| 38 | |
| 39 | Recommended defaults: |
| 40 | |
| 41 | - Choose **se_e2_a** for a robust baseline, small to medium systems, compatibility-focused workflows, or when compute is limited. |
| 42 | - Choose **DPA3** for high accuracy on diverse datasets, LAM-style training, or when the user explicitly asks for DPA3, DPA-3, LiGS, dynamic neighbor selection, or pretrained DPA3 variants. |
| 43 | |
| 44 | ## Common workflow |
| 45 | |
| 46 | ### 1. Confirm environment |
| 47 | |
| 48 | ```bash |
| 49 | dp --version |
| 50 | ``` |
| 51 | |
| 52 | For PyTorch training, use `dp --pt ...`; for TensorFlow, use `dp ...`; for other backends, confirm the installed backend first. |
| 53 | |
| 54 | ### 2. Confirm training data |
| 55 | |
| 56 | Training data should be in DeePMD format, typically deepmd/npy or deepmd/hdf5. If the user has raw electronic-structure outputs, convert them first with dpdata before writing the training input. |
| 57 | |
| 58 | Minimum information needed to build `input.json`: |
| 59 | |
| 60 | - `type_map` |
| 61 | - training system paths |
| 62 | - validation system paths |
| 63 | - whether virial labels are present and should be trained |
| 64 | - target number of steps or accuracy/time budget |
| 65 | - model choice |
| 66 | |
| 67 | ### 3. Read the selected model reference |
| 68 | |
| 69 | After selecting a model, read the corresponding file under [`models/`](models/) and apply its model-specific configuration, hyperparameters, and caveats. |
| 70 | |
| 71 | ### 4. Train |
| 72 | |
| 73 | ```bash |
| 74 | dp --pt train input.json |
| 75 | ``` |
| 76 | |
| 77 | Use the backend-specific command if not using PyTorch. |
| 78 | |
| 79 | Restart from a checkpoint when needed: |
| 80 | |
| 81 | ```bash |
| 82 | dp --pt train input.json --restart model.ckpt.pt |
| 83 | ``` |
| 84 | |
| 85 | ### 5. Monitor |
| 86 | |
| 87 | Training progress is usually written to `lcurve.out`. Check for: |
| 88 | |
| 89 | - decreasing validation RMSE |
| 90 | - NaN or exploding losses |
| 91 | - train/validation divergence |
| 92 | - learning-rate schedule behaving as expected |
| 93 | |
| 94 | ### 6. Freeze and test |
| 95 | |
| 96 | ```bash |
| 97 | dp --pt freeze -o model.pth |
| 98 | dp --pt test -m model.pth -s /path/to/test_system -n 30 |
| 99 | ``` |
| 100 | |
| 101 | Adjust the backend flags and output extension for non-PyTorch models. |
| 102 | |
| 103 | ## Agent checklist |
| 104 | |
| 105 | - [ ] Model was selected before reading model-specific details. |
| 106 | - [ ] Only the selected model reference was |