Skip to content

Commit a4be608

Browse files
committed
update doc
1 parent f4fda39 commit a4be608

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

doc/model/train-energy.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,30 @@ The {ref}`intensive_ener_virial <loss[ener]/intensive_ener_virial>` option (defa
150150

151151
If one does not want to train with virial, then he/she may set the virial prefactors {ref}`start_pref_v <loss[ener]/start_pref_v>` and {ref}`limit_pref_v <loss[ener]/limit_pref_v>` to 0.
152152

153+
### Prefactor force loss with default atom preference
154+
155+
:::{note}
156+
**Supported backends**: PyTorch {{ pytorch_icon }}, DP {{ dpmodel_icon }}
157+
:::
158+
159+
When using the prefactor force loss (controlled by {ref}`start_pref_pf <loss[ener]/start_pref_pf>` and {ref}`limit_pref_pf <loss[ener]/limit_pref_pf>`), the training data typically requires an `atom_pref.npy` file in each system directory to specify per-atom prefactors $q_k$. If `atom_pref.npy` is not provided, the {ref}`use_default_pf <loss[ener]/use_default_pf>` option can be set to `true` to use a default atom preference of 1.0 for all atoms:
160+
161+
```json
162+
"loss" : {
163+
"start_pref_e": 0.02,
164+
"limit_pref_e": 1,
165+
"start_pref_f": 1000,
166+
"limit_pref_f": 1,
167+
"start_pref_v": 0,
168+
"limit_pref_v": 0,
169+
"start_pref_pf": 1.0,
170+
"limit_pref_pf": 1.0,
171+
"use_default_pf": true
172+
}
173+
```
174+
175+
This allows using the prefactor force loss without requiring `atom_pref.npy` files. When `atom_pref.npy` is provided in the training data, it will be used as-is regardless of the `use_default_pf` setting.
176+
177+
Note that `use_default_pf` is only effective for the PyTorch and DP (NumPy reference) backends. The TensorFlow and Paddle backends raise `NotImplementedError` when `use_default_pf` is set to `true`.
178+
153179
[^1]: This section is built upon Jinzhe Zeng, Duo Zhang, Denghui Lu, Pinghui Mo, Zeyu Li, Yixiao Chen, Marián Rynik, Li'ang Huang, Ziyao Li, Shaochen Shi, Yingze Wang, Haotian Ye, Ping Tuo, Jiabin Yang, Ye Ding, Yifan Li, Davide Tisi, Qiyu Zeng, Han Bao, Yu Xia, Jiameng Huang, Koki Muraoka, Yibo Wang, Junhan Chang, Fengbo Yuan, Sigbjørn Løland Bore, Chun Cai, Yinnian Lin, Bo Wang, Jiayan Xu, Jia-Xin Zhu, Chenxing Luo, Yuzhi Zhang, Rhys E. A. Goodall, Wenshuo Liang, Anurag Kumar Singh, Sikai Yao, Jingchao Zhang, Renata Wentzcovitch, Jiequn Han, Jie Liu, Weile Jia, Darrin M. York, Weinan E, Roberto Car, Linfeng Zhang, Han Wang, [J. Chem. Phys. 159, 054801 (2023)](https://doi.org/10.1063/5.0155600) licensed under a [Creative Commons Attribution (CC BY) license](http://creativecommons.org/licenses/by/4.0/).

doc/model/train-se-a-mask.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,6 @@ And the `loss` section in the training input script should be set as follows.
8585
}
8686
```
8787

88-
If `atom_pref.npy` is not provided in the training data, one can set `use_default_pf` to `true` to use a default atom preference of 1.0 for all atoms. This allows using the prefactor force loss (`pf` loss) without requiring `atom_pref.npy` files. When `atom_pref.npy` is provided, it will be used as-is regardless of this setting.
89-
90-
```json
91-
"loss": {
92-
"type": "ener",
93-
"start_pref_e": 0.0,
94-
"limit_pref_e": 0.0,
95-
"start_pref_f": 0.0,
96-
"limit_pref_f": 0.0,
97-
"start_pref_pf": 1.0,
98-
"limit_pref_pf": 1.0,
99-
"use_default_pf": true,
100-
"_comment": " that's all"
101-
}
102-
```
103-
10488
## Type embedding
10589

10690
Same as [`se_e2_a`](./train-se-e2-a.md).

0 commit comments

Comments
 (0)