jinzhezenggroup/computational-chemistry-agent-skills/deepmd-finetune-dpa3
Claude Code and agent skill by jinzhezenggroup/computational-chemistry-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Fine-tune a DPA3 model in DeePMD-kit using the PyTorch backend. Use when the user wants to adapt a pre-trained DPA3 model to a new downstream dataset. Supports fine-tuning from a self-trained DPA3 model (.pt checkpoint), from a multi-task pre-trained model, or from a built-in pretrained model downloaded via `dp pretrained download` (e.g., DPA-3.1-3M, DPA-3.2-5M, DPA-3.3-1M). Covers single-task and multi-task fine-tuning workflows.
Install
npx vskill@latest install jinzhezenggroup/computational-chemistry-agent-skills/deepmd-finetune-dpa3SKILL.md
DeePMD-kit Fine-tuning: DPA3
Fine-tune a pre-trained DPA3 model on a downstream dataset. This skill covers three scenarios:
- Fine-tuning from a self-trained single-task DPA3 model
- Fine-tuning from a multi-task pre-trained DPA3 model
- Fine-tuning from a built-in pretrained model (e.g., DPA-3.1-3M, DPA-3.2-5M, DPA-3.3-1M) downloaded via
dp pretrained download
Quick Start
Agent Responsibilities
- Determine the fine-tuning scenario:
- Does the user have a self-trained
.ptmodel? - Does the user want to use a built-in pretrained model (DPA-3.1-3M, DPA-3.2-5M, DPA-3.3-1M, etc.)?
- Is the pre-trained model single-task or multi-task?
- If using a built-in pretrained model, download it first with
dp pretrained download. - Collect the downstream training data paths and element types.
- Generate the fine-tuning
input.json. - Run fine-tuning and monitor the learning curve.
- Freeze and test the fine-tuned model.
Scenario 1: Fine-tune from a Self-trained Single-task Model
When you have trained a DPA3 model yourself and want to adapt it to new data.
Step 1: Prepare input.json
When using --use-pretrain-script, the model architecture is inherited from the pre-trained model. You only need to specify type_map, data paths, and training parameters:
Fine-tuning tips:
- Use a smaller
start_lr(e.g., 1e-4) than training from scratch (1e-3). - Use fewer
numb_stepssince the model is already pre-trained. - The elements in the downstream data must be a subset of the pre-trained model's
type_map.
Step 2: Run Fine-tuning
The --use-pretrain-script flag tells DeePMD-kit to inherit the model architecture from the pre-trained model, so the descriptor and fitting_net sections in input.json can be empty.
Without --use-pretrain-script, the model section in input.json must exactly match the pre-trained model's architecture.
Scenario 2: Fine-tune from a Multi-task Pre-trained Model
When the pre-trained model was trained with multiple datasets (multi-task training), you can select a specific branch to fine-tune from.
Check Available Branches
Run Fine-tuning from a Specific Branch
If --model-branch is not set or set to RANDOM, a randomly initialized fitting net will be used.
Multi-task Fine-tuning (Prevent Forgetting)
To retain knowledge from the pre-trained datasets during fine-tuning, use multi-task fine-tuning. Prepare a multi-task input script:
Key points:
"finetune_head": "pre_data_1"specifies which branch the downstream task fine-tunes from.model_probcontrols the sampling probability for each dataset.- Pre-trained branches continue training in
init-modelmode; the downstream branch fine-tunes from the selected head.
Run:
Freeze a specific branch:
Scenario 3: Fine-tune from Built-in Pretrained Models
DeePMD-kit provides built-in pretrained models that can be downloaded directly.
Step 1: Check Available Models
Currently available models include:
DPA-3.3-1M— 1M parameter DPA3 pretrained modelDPA-3.2-5M— latest large-scale pretrained modelDPA-3.1-3M— 3M parameter DPA3 pretrained modelDPA3-Omol-Large— large organic molecule model
Step 2: Download the Model
The command prints the local path of the downloaded model file on success.
Step 3: Check Model Branches (if multi-task)
Step 4: Prepare input.json and Run Fine-tuning
The input.json is the same as Scenario 1. Use --use-pretrain-script to inherit the model architecture:
The meaning of each parameter can be generated through dp doc-train-input. Considering the output RST documentation on the screen is very long, use grep to find the documentation of a specific parameter:
Run fine-tuning:
Step 5: Freeze and Test
Fine-tuning Command Reference
| Command | Description | |
|---|---|---|
dp pretrained download <MODEL> | Download a built-in pretrained model | |
dp pretrained download <MODEL> --cache-dir <PATH> | Download to a custom directory | |
dp --pt train input.json --finetune <MODEL>.pt | Fine-tune from a pre-trained model | |
dp --pt train input.json --finetune <MODEL>.pt --use-pretrain-script | Inherit model architecture from pre-trained model | |
dp --pt train input.json --finetune <MODEL>.pt --model-branch <BRANCH> | Fine-tune from a specific branch | |
dp --pt train input.json --finetune <MODEL>.pt --model-branch RANDOM | Fine-tune with random fitting net | |
dp --pt show <MODEL>.pt model-branch | List available branches in a multi-task model | |
dp --pt freeze -o model.pth | Freeze the fine-tuned model | |
dp --pt freeze -o model.pth --head <BRANCH> | Freeze a specific branch (multi-task) |
Agent Checklist
- [ ] Pre-trained model file exists (downloaded or self-trained)
- [ ] Downstream data elements are a subset of the pre-trained model's
type_map - [ ]
--use-pretrain-scriptis used if model architecture is unknown - [ ] Learning rate is reduced compared to training from scratch (e.g., 1e-4 vs 1e-3)
- [ ] For multi-task pretrained models, the correct
--model-branchis selected - [ ] Training completes without NaN in
lcurve.out - [ ] Fine-tuned model is frozen and tested
- [ ] Test RMSE values are reported to the user
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmachine-learning-potentials/deepmd-finetune-dpa3/SKILL.md
Popularity
- Repository stars
- 118
- Repository forks
- 24
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 12 Oct 2026, 24 days ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jinzhezenggroup/computational-chemistry-agent-skills/deepmd-finetune-dpa3)