Skip to content

Commit

Permalink
Chore(pt):rm old pt implementation (#4223)
Browse files Browse the repository at this point in the history
Fix #3913.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced `exclude_types` parameter in `DipoleFittingNet` and
`PolarFittingNet` constructors for improved flexibility.
  - Added `SimpleLinear` class to enhance network functionality.

- **Bug Fixes**
- Removed `old_impl` parameter across various classes, streamlining
interfaces and ensuring consistent behavior.

- **Documentation**
- Updated test cases to reflect the removal of `old_impl`, focusing on
new implementations.

- **Chores**
- Deleted obsolete files and classes to simplify the codebase and
improve maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
iProzd and pre-commit-ci[bot] authored Oct 17, 2024
1 parent af86b57 commit 2871fec
Show file tree
Hide file tree
Showing 29 changed files with 206 additions and 3,495 deletions.
3 changes: 0 additions & 3 deletions deepmd/dpmodel/fitting/dipole_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def __init__(
r_differentiable: bool = True,
c_differentiable: bool = True,
type_map: Optional[list[str]] = None,
old_impl=False,
seed: Optional[Union[int, list[int]]] = None,
):
if tot_ener_zero:
Expand Down Expand Up @@ -141,7 +140,6 @@ def __init__(
type_map=type_map,
seed=seed,
)
self.old_impl = False

def _net_out_dim(self):
"""Set the FittingNet output dim."""
Expand All @@ -151,7 +149,6 @@ def serialize(self) -> dict:
data = super().serialize()
data["type"] = "dipole"
data["embedding_width"] = self.embedding_width
data["old_impl"] = self.old_impl
data["r_differentiable"] = self.r_differentiable
data["c_differentiable"] = self.c_differentiable
return data
Expand Down
3 changes: 0 additions & 3 deletions deepmd/dpmodel/fitting/polarizability_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def __init__(
spin: Any = None,
mixed_types: bool = False,
exclude_types: list[int] = [],
old_impl: bool = False,
fit_diag: bool = True,
scale: Optional[list[float]] = None,
shift_diag: bool = True,
Expand Down Expand Up @@ -165,7 +164,6 @@ def __init__(
type_map=type_map,
seed=seed,
)
self.old_impl = False

def _net_out_dim(self):
"""Set the FittingNet output dim."""
Expand All @@ -192,7 +190,6 @@ def serialize(self) -> dict:
data["type"] = "polar"
data["@version"] = 3
data["embedding_width"] = self.embedding_width
data["old_impl"] = self.old_impl
data["fit_diag"] = self.fit_diag
data["shift_diag"] = self.shift_diag
data["@variables"]["scale"] = self.scale
Expand Down
12 changes: 0 additions & 12 deletions deepmd/pt/model/backbone/__init__.py

This file was deleted.

12 changes: 0 additions & 12 deletions deepmd/pt/model/backbone/backbone.py

This file was deleted.

103 changes: 0 additions & 103 deletions deepmd/pt/model/backbone/evoformer2b.py

This file was deleted.

4 changes: 0 additions & 4 deletions deepmd/pt/model/descriptor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
from .env_mat import (
prod_env_mat,
)
from .gaussian_lcc import (
DescrptGaussianLcc,
)
from .hybrid import (
DescrptHybrid,
)
Expand Down Expand Up @@ -59,6 +56,5 @@
"DescrptDPA2",
"DescrptHybrid",
"prod_env_mat",
"DescrptGaussianLcc",
"DescrptBlockRepformers",
]
2 changes: 0 additions & 2 deletions deepmd/pt/model/descriptor/dpa1.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def __init__(
# not implemented
spin=None,
type: Optional[str] = None,
old_impl: bool = False,
):
super().__init__()
# Ensure compatibility with the deprecated stripped_type_embedding option.
Expand Down Expand Up @@ -290,7 +289,6 @@ def __init__(
trainable_ln=trainable_ln,
ln_eps=ln_eps,
seed=child_seed(seed, 1),
old_impl=old_impl,
)
self.use_econf_tebd = use_econf_tebd
self.use_tebd_bias = use_tebd_bias
Expand Down
2 changes: 0 additions & 2 deletions deepmd/pt/model/descriptor/dpa2.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def __init__(
use_econf_tebd: bool = False,
use_tebd_bias: bool = False,
type_map: Optional[list[str]] = None,
old_impl: bool = False,
):
r"""The DPA-2 descriptor. see https://arxiv.org/abs/2312.15492.
Expand Down Expand Up @@ -235,7 +234,6 @@ def init_subclass_params(sub_data, sub_class):
g1_out_conv=self.repformer_args.g1_out_conv,
g1_out_mlp=self.repformer_args.g1_out_mlp,
seed=child_seed(seed, 1),
old_impl=old_impl,
)
self.rcsl_list = [
(self.repformers.get_rcut(), self.repformers.get_nsel()),
Expand Down
Loading

0 comments on commit 2871fec

Please sign in to comment.