Skip to content

Commit

Permalink
fix(pt/tf/dp): normalize the econf (deepmodeling#3976)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Improvements**
- Enhanced the accuracy of energy configuration embeddings by adding a
normalization step.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
iProzd authored Jul 14, 2024
1 parent e7add45 commit ad96750
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions deepmd/dpmodel/utils/type_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,6 @@ def get_econf_tebd(type_map, precision: str = "default"):
[electronic_configuration_embedding[kk] for kk in type_map],
dtype=PRECISION_DICT[precision],
)
econf_tebd /= econf_tebd.sum(-1, keepdims=True) # do normalization
embed_input_dim = ECONF_DIM
return econf_tebd, embed_input_dim

0 comments on commit ad96750

Please sign in to comment.