You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change the smooth method in se_atten descriptor (#2755)
This PR edits the smooth method of se_atten descriptor when using
stripped type embedding:
1. Change the structure in stripped type embedding and compression ops.
2. Add smooth factor on the network output of type embedding.
3. Add a new descriptor se_atten_v2 to include these changes while
keeping se_atten in old behaviors.
---------
Co-authored-by: nahso <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: deepmd/utils/argcheck.py
+41-14Lines changed: 41 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -333,9 +333,7 @@ def descrpt_hybrid_args():
333
333
]
334
334
335
335
336
-
@descrpt_args_plugin.register("se_atten")
337
-
defdescrpt_se_atten_args():
338
-
doc_stripped_type_embedding="Whether to strip the type embedding into a separated embedding network. Setting it to `False` will fall back to the previous version of `se_atten` which is non-compressible."
336
+
defdescrpt_se_atten_common_args():
339
337
doc_sel='This parameter set the number of selected neighbors. Note that this parameter is a little different from that in other descriptors. Instead of separating each type of atoms, only the summation matters. And this number is highly related with the efficiency, thus one should not make it too large. Usually 200 or less is enough, far away from the GPU limitation 4096. It can be:\n\n\
340
338
- `int`. The maximum number of neighbor atoms to be considered. We recommend it to be less than 200. \n\n\
341
339
- `List[int]`. The length of the list should be the same as the number of atom types in the system. `sel[i]` gives the selected number of type-i neighbors. Only the summation of `sel[i]` matters, and it is recommended to be less than 200.\
doc_precision=f"The precision of the embedding net parameters, supported options are {list_to_doc(PRECISION_DICT.keys())} Default follows the interface precision."
351
349
doc_trainable="If the parameters in the embedding net is trainable"
352
350
doc_seed="Random seed for parameter initialization"
353
-
doc_set_davg_zero="Set the normalization average to zero. This option should be set when `se_atten` descriptor or `atom_ener` in the energy fitting is used"
354
351
doc_exclude_types="The excluded pairs of types which have no interaction with each other. For example, `[[0, 1]]` means no interaction between type 0 and type 1."
355
352
doc_attn="The length of hidden vectors in attention layers"
356
353
doc_attn_layer="The number of attention layers. Note that model compression of `se_atten` is only enabled when attn_layer==0 and stripped_type_embedding is True"
357
354
doc_attn_dotr="Whether to do dot product with the normalized relative coordinates"
358
355
doc_attn_mask="Whether to do mask on the diagonal in the attention matrix"
doc_stripped_type_embedding="Whether to strip the type embedding into a separated embedding network. Setting it to `False` will fall back to the previous version of `se_atten` which is non-compressible."
397
+
doc_smooth_type_embdding="When using stripped type embedding, whether to dot smooth factor on the network output of type embedding to keep the network smooth, instead of setting `set_davg_zero` to be True."
398
+
doc_set_davg_zero="Set the normalization average to zero. This option should be set when `se_atten` descriptor or `atom_ener` in the energy fitting is used"
doc_set_davg_zero="Set the normalization average to zero. This option should be set when `se_atten` descriptor or `atom_ener` in the energy fitting is used"
doc_descrpt_type="The type of the descritpor. See explanation below. \n\n\
463
489
- `loc_frame`: Defines a local frame at each atom, and the compute the descriptor as local coordinates under this frame.\n\n\
464
490
- `se_e2_a`: Used by the smooth edition of Deep Potential. The full relative coordinates are used to construct the descriptor.\n\n\
465
491
- `se_e2_r`: Used by the smooth edition of Deep Potential. Only the distance between atoms is used to construct the descriptor.\n\n\
466
492
- `se_e3`: Used by the smooth edition of Deep Potential. The full relative coordinates are used to construct the descriptor. Three-body embedding will be used by this descriptor.\n\n\
467
493
- `se_a_tpe`: Used by the smooth edition of Deep Potential. The full relative coordinates are used to construct the descriptor. Type embedding will be used by this descriptor.\n\n\
468
494
- `se_atten`: Used by the smooth edition of Deep Potential. The full relative coordinates are used to construct the descriptor. Attention mechanism will be used by this descriptor.\n\n\
495
+
- `se_atten_v2`: Used by the smooth edition of Deep Potential. The full relative coordinates are used to construct the descriptor. Attention mechanism with new modifications will be used by this descriptor.\n\n\
469
496
- `se_a_mask`: Used by the smooth edition of Deep Potential. It can accept a variable number of atoms in a frame (Non-PBC system). *aparam* are required as an indicator matrix for the real/virtual sign of input atoms. \n\n\
470
497
- `hybrid`: Concatenate of a list of descriptors as a new descriptor."
0 commit comments