caic99 commited on
Commit
50dcaf9
·
verified ·
1 Parent(s): d7261ed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +75 -3
README.md CHANGED
@@ -1,3 +1,75 @@
1
- ---
2
- license: cc-by-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ ---
4
+
5
+ # Description
6
+
7
+ DPA-3.1-3M is trained using a multitask strategy on the [OpenLAM datasets](https://www.aissquare.com/datasets/detail?pageType=datasets&name=OpenLAM-TrainingSet-v1&id=308). The benchmark results can be found at the [LAMBench website.](https://www.aissquare.com/openlam?tab=Benchmark)
8
+
9
+ Please ensure the usage of the correct code version (**v3.1.0**) corresponding to this model.
10
+
11
+ # How to use
12
+ ## Installation
13
+
14
+ To use the pretrained model, you need to first install the corresponding version of DeePMD-kit. You can try easy installation:
15
+
16
+ ```bash
17
+ pip install torch torchvision torchaudio
18
+ pip install git+https://github.com/deepmodeling/deepmd-kit@v3.1.0
19
+ ```
20
+
21
+ For other installation options, please visit the [Releases page](https://github.com/deepmodeling/deepmd-kit/releases/tag/v3.1.0) to download the off-line package for **deepmd-kit devel**, and refer to the [official documentation](https://docs.deepmodeling.com/projects/deepmd/en/stable/install/easy-install.html) for off-line installation instructions.
22
+
23
+ ## Use the pretrained model
24
+
25
+ The pretrained model can be used directly for prediction tasks, such as serving as an ASE calculator.
26
+
27
+ This model is pretrained in a multi-task manner, featuring a unified backbone (referred to as the unified descriptor and the unified fitting net) and an dataset encoding vector for different tasks. For detailed information, refer to the [DPA-3 paper](https://arxiv.org/abs/2506.01686).
28
+
29
+ The first step involves selecting a specific dataset id from the model to make predictions. To list the available fitting nets (`model-branch`) in this pretrained model, use the following command:
30
+
31
+ ```bash
32
+ dp --pt show DPA-3.1-3M.pt model-branch
33
+ ```
34
+
35
+ This will generate an output similar to the following:
36
+
37
+ ```plaintext
38
+ Available model branches are ['Domains_Alloy', 'Domains_Anode', 'Domains_Cluster',
39
+ 'Domains_Drug', 'Domains_FerroEle', 'Domains_SSE_PBE', 'Domains_SemiCond', 'H2O_H2O_PD',
40
+ 'Metals_AlMgCu', 'Metals_Sn', 'Metals_Ti', 'Metals_V', 'Metals_W', 'Others_HfO2',
41
+ 'Domains_SSE_PBESol', 'Domains_Transition1x', 'Metals_AgAu_PBED3', 'Others_In2Se3',
42
+ 'MP_traj_v024_alldata_mixu', 'Alloy_tongqi', 'SSE_ABACUS', 'Hybrid_Perovskite',
43
+ 'solvated_protein_fragments', 'Electrolyte', 'ODAC23', 'Alex2D', 'Omat24', 'SPICE2', 'OC20M',
44
+ 'OC22', 'Organic_Reactions', 'RANDOM'], where 'RANDOM' means using a randomly initialized
45
+ fitting net.
46
+ ```
47
+
48
+ Select a dataset id that closely matches your system. Ensure that the elements in your system are included in the corresponding task if you are conducting direct predictions or simulations. For more information on the pretrained datasets, refer to [below](https://www.aissquare.com/models/detail?pageType=models&name=DPA-2.3.1-v3.0.0rc0&id=287#data-used-for-pretraining).
49
+
50
+ Assuming you choose `H2O_H2O-PD`, you can first freeze the model branch from the multi-task pretrained model:
51
+
52
+ ```bash
53
+ dp --pt freeze -c DPA-3.1-3M.pt -o frozen_model.pth --model-branch H2O_H2O-PD
54
+ ```
55
+
56
+ Then you can use the following Python code for prediction or optimization:
57
+
58
+ ```python
59
+ ## Compute potential energy
60
+ from ase import Atoms
61
+ from deepmd.calculator import DP as DPCalculator
62
+ dp = DPCalculator("frozen_model.pth")
63
+ water = Atoms('H2O', positions=[(0.7601, 1.9270, 1), (1.9575, 1, 1), (1., 1., 1.)], cell=[100, 100, 100])
64
+ water.calc = dp
65
+ print(water.get_potential_energy())
66
+ print(water.get_forces())
67
+
68
+ ## Run BFGS structure optimization
69
+ from ase.optimize import BFGS
70
+ dyn = BFGS(water)
71
+ dyn.run(fmax=1e-6)
72
+ print(water.get_positions())
73
+ ```
74
+
75
+ For more advanced usages like fine-tuning and zero-shot inference, please refer to the following [model card](https://www.aissquare.com/models/detail?pageType=models&name=DPA-2.3.1-v3.0.0rc0&id=287) .