From 3a34c566ea3fe55207e206ba0cf8d805d9044905 Mon Sep 17 00:00:00 2001 From: Duo <50307526+iProzd@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:31:50 +0800 Subject: [PATCH] Update dpa1.py --- deepmd/dpmodel/descriptor/dpa1.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deepmd/dpmodel/descriptor/dpa1.py b/deepmd/dpmodel/descriptor/dpa1.py index 342639414f..8833348b52 100644 --- a/deepmd/dpmodel/descriptor/dpa1.py +++ b/deepmd/dpmodel/descriptor/dpa1.py @@ -505,11 +505,11 @@ def call( # calculate gg gg = self.cal_g(ss, 0) - input_r = dmatrix.reshape(-1, nnei, 4)[:, :, 1:4] / ( + input_r = dmatrix.reshape(-1, nnei, 4)[:, :, 1:4] / np.maximum( np.linalg.norm( dmatrix.reshape(-1, nnei, 4)[:, :, 1:4], axis=-1, keepdims=True - ) - + 1e-12 + ), + 1e-12, ) gg = self.dpa1_attention( gg, nlist_mask, input_r=input_r, sw=sw