Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pt): fix seed in dpmodel fitting #3916

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions deepmd/dpmodel/fitting/dipole_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ def __init__(
c_differentiable: bool = True,
type_map: Optional[List[str]] = None,
old_impl=False,
# not used
seed: Optional[Union[int, List[int]]] = None,
):
# seed, uniform_seed are not included
if tot_ener_zero:
raise NotImplementedError("tot_ener_zero is not implemented")
if spin is not None:
Expand Down Expand Up @@ -143,6 +141,7 @@ def __init__(
mixed_types=mixed_types,
exclude_types=exclude_types,
type_map=type_map,
seed=seed,
)
self.old_impl = False

Expand Down
2 changes: 1 addition & 1 deletion deepmd/dpmodel/fitting/dos_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def __init__(
mixed_types: bool = False,
exclude_types: List[int] = [],
iProzd marked this conversation as resolved.
Show resolved Hide resolved
type_map: Optional[List[str]] = None,
# not used
seed: Optional[Union[int, List[int]]] = None,
):
if bias_dos is not None:
Expand All @@ -69,6 +68,7 @@ def __init__(
mixed_types=mixed_types,
exclude_types=exclude_types,
type_map=type_map,
seed=seed,
)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion deepmd/dpmodel/fitting/ener_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(
mixed_types: bool = False,
exclude_types: List[int] = [],
type_map: Optional[List[str]] = None,
# not used
seed: Optional[Union[int, List[int]]] = None,
):
super().__init__(
Expand All @@ -70,6 +69,7 @@ def __init__(
mixed_types=mixed_types,
exclude_types=exclude_types,
type_map=type_map,
seed=seed,
)

@classmethod
Expand Down
4 changes: 3 additions & 1 deletion deepmd/dpmodel/fitting/invar_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Dict,
List,
Optional,
Union,
)

import numpy as np
Expand Down Expand Up @@ -134,8 +135,8 @@ def __init__(
mixed_types: bool = True,
exclude_types: List[int] = [],
iProzd marked this conversation as resolved.
Show resolved Hide resolved
type_map: Optional[List[str]] = None,
seed: Optional[Union[int, List[int]]] = None,
):
# seed, uniform_seed are not included
if tot_ener_zero:
raise NotImplementedError("tot_ener_zero is not implemented")
if spin is not None:
Expand Down Expand Up @@ -172,6 +173,7 @@ def __init__(
if atom_ener is None or len([x for x in atom_ener if x is not None]) == 0
else [x is not None for x in atom_ener],
type_map=type_map,
seed=seed,
)

def serialize(self) -> dict:
Expand Down
3 changes: 1 addition & 2 deletions deepmd/dpmodel/fitting/polarizability_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ def __init__(
scale: Optional[List[float]] = None,
shift_diag: bool = True,
type_map: Optional[List[str]] = None,
# not used
seed: Optional[Union[int, List[int]]] = None,
):
# seed, uniform_seed are not included
if tot_ener_zero:
raise NotImplementedError("tot_ener_zero is not implemented")
if spin is not None:
Expand Down Expand Up @@ -167,6 +165,7 @@ def __init__(
mixed_types=mixed_types,
exclude_types=exclude_types,
type_map=type_map,
seed=seed,
)
self.old_impl = False

Expand Down