From ad967504491b3b1b8542c921065adb3ef5c786d5 Mon Sep 17 00:00:00 2001 From: Duo <50307526+iProzd@users.noreply.github.com> Date: Sun, 14 Jul 2024 13:08:23 +0800 Subject: [PATCH] fix(pt/tf/dp): normalize the econf (#3976) ## Summary by CodeRabbit - **Improvements** - Enhanced the accuracy of energy configuration embeddings by adding a normalization step. --- deepmd/dpmodel/utils/type_embed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/deepmd/dpmodel/utils/type_embed.py b/deepmd/dpmodel/utils/type_embed.py index cf9b31e607..2e695171d6 100644 --- a/deepmd/dpmodel/utils/type_embed.py +++ b/deepmd/dpmodel/utils/type_embed.py @@ -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