Skip to content

Commit

Permalink
Fix uts
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed May 10, 2024
1 parent 0580704 commit 1b85b01
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
23 changes: 17 additions & 6 deletions source/tests/common/dpmodel/test_descriptor_dpa2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from deepmd.dpmodel.descriptor import (
DescrptDPA2,
)
from deepmd.dpmodel.descriptor.dpa2 import (
RepformerArgs,
RepinitArgs,
)

from .case_single_frame_with_nlist import (
TestCaseSingleFrameWithNlist,
Expand All @@ -28,14 +32,21 @@ def test_self_consistency(
dstd = 0.1 + np.abs(dstd)
dstd_2 = 0.1 + np.abs(dstd_2)

repinit = RepinitArgs(
rcut=self.rcut,
rcut_smth=self.rcut_smth,
nsel=self.sel_mix,
)
repformer = RepformerArgs(
rcut=self.rcut / 2,
rcut_smth=self.rcut_smth,
nsel=nnei // 2,
)

em0 = DescrptDPA2(
ntypes=self.nt,
repinit_rcut=self.rcut,
repinit_rcut_smth=self.rcut_smth,
repinit_nsel=self.sel_mix,
repformer_rcut=self.rcut / 2,
repformer_rcut_smth=self.rcut_smth,
repformer_nsel=nnei // 2,
repinit=repinit,
repformer=repformer,
)

em0.repinit.mean = davg
Expand Down
63 changes: 34 additions & 29 deletions source/tests/pt/model/models/dpa2.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,40 @@
],
"descriptor": {
"type": "dpa2",
"repinit_rcut": 6.0,
"repinit_rcut_smth": 2.0,
"repinit_nsel": 30,
"repformer_rcut": 4.0,
"repformer_rcut_smth": 0.5,
"repformer_nsel": 10,
"repinit_neuron": [
2,
4,
8
],
"repinit_axis_neuron": 4,
"repinit_activation_function": "tanh",
"repformer_nlayers": 12,
"repformer_g1_dim": 8,
"repformer_g2_dim": 5,
"repformer_attn2_hidden": 3,
"repformer_attn2_nhead": 1,
"repformer_attn1_hidden": 5,
"repformer_attn1_nhead": 1,
"repformer_axis_neuron": 4,
"repformer_update_h2": false,
"repformer_update_g1_has_conv": true,
"repformer_update_g1_has_grrg": true,
"repformer_update_g1_has_drrd": true,
"repformer_update_g1_has_attn": true,
"repformer_update_g2_has_g1g1": true,
"repformer_update_g2_has_attn": true,
"repformer_attn2_has_gate": true,
"repinit": {
"rcut": 6.0,
"rcut_smth": 2.0,
"nsel": 30,
"neuron": [
2,
4,
8
],
"axis_neuron": 4,
"activation_function": "tanh"

},
"repformer": {
"rcut": 4.0,
"rcut_smth": 0.5,
"nsel": 10,
"nlayers": 12,
"g1_dim": 8,
"g2_dim": 5,
"attn2_hidden": 3,
"attn2_nhead": 1,
"attn1_hidden": 5,
"attn1_nhead": 1,
"axis_neuron": 4,
"update_h2": false,
"update_g1_has_conv": true,
"update_g1_has_grrg": true,
"update_g1_has_drrd": true,
"update_g1_has_attn": true,
"update_g2_has_g1g1": true,
"update_g2_has_attn": true,
"attn2_has_gate": true
},
"add_tebd_to_repinit_out": false
},
"fitting_net": {
Expand Down

0 comments on commit 1b85b01

Please sign in to comment.