Skip to content

Commit

Permalink
refact: the DPA1 descriptor (#3696)
Browse files Browse the repository at this point in the history
This PR reformat DPA1 descriptor consistent for TF/PT/DP

- Clean up the implementation of DPA1 descriptor in TF/PT
- Add numpy implementation for DPA1 descriptor
- Add `serialize` and `deserialize` for DPA1 descriptor in TF/PT/DP
- Add consistence test for TF/PT/DP

Now DPA1 descriptor in TF and PT&DP are consistent when:
`smooth_type_embdding` == False
`env_protection` == 0.0
`stripped_type_embedding` == False

 DPA1 descriptor in PT and DP are always consistent.

Need to fix 
- consistence in TF: when `excluded_types` != [] and `attn_layer` > 0.

---------

Signed-off-by: Duo <50307526+iProzd@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
iProzd and coderabbitai[bot] committed Apr 24, 2024
1 parent 1985631 commit d0cd9f3
Show file tree
Hide file tree
Showing 27 changed files with 3,626 additions and 402 deletions.
4 changes: 4 additions & 0 deletions deepmd/dpmodel/descriptor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
from .dpa1 import (
DescrptDPA1,
)
from .hybrid import (
DescrptHybrid,
)
Expand All @@ -15,6 +18,7 @@
__all__ = [
"DescrptSeA",
"DescrptSeR",
"DescrptDPA1",
"DescrptHybrid",
"make_base_descriptor",
]

0 comments on commit d0cd9f3

Please sign in to comment.