Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 15, 2024
1 parent b52065c commit c0f09e6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deepmd/dpmodel/output_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
IntEnum,
)
from typing import (
Union,
Optional,
Union,
)


Expand Down
4 changes: 3 additions & 1 deletion deepmd/pt/loss/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def __init__(
property_dim = [property_dim]
self.property_name = property_name
assert self.task_dim == sum(property_dim)
assert len(property_name) == len(property_dim), f"The shape of the `property_name` you provide must be consistent with the `property_dim`, but your `property_name` is {property_name} and your `property_dim` is {property_dim}!"
assert (
len(property_name) == len(property_dim)
), f"The shape of the `property_name` you provide must be consistent with the `property_dim`, but your `property_name` is {property_name} and your `property_dim` is {property_dim}!"
self.property_name_dim_mapping = dict(zip(property_name, property_dim))
self.out_bias = out_bias
self.out_std = out_std
Expand Down
2 changes: 1 addition & 1 deletion deepmd/pt/model/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _get_standard_model_components(model_params, ntypes):
fitting_net["return_energy"] = True
if "property" in fitting_net["type"]:
if isinstance(fitting_net["property_dim"], list):
fitting_net["task_dim"] = sum(fitting_net["property_dim"])
fitting_net["task_dim"] = sum(fitting_net["property_dim"])
else:
fitting_net["task_dim"] = fitting_net["property_dim"]
fitting = BaseFitting(**fitting_net)
Expand Down
10 changes: 6 additions & 4 deletions deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,12 @@ def compute_output_stats_global(
concat_bias.append(bias_atom_e[ii])
concat_std.append(std_atom_e[ii])
bias_atom_e = {"property": np.concatenate(concat_bias, axis=-1)}
std_atom_e = {"property": np.tile(
np.concatenate(concat_std, axis=-1),
(bias_atom_e["property"].shape[0], 1)
)}
std_atom_e = {
"property": np.tile(
np.concatenate(concat_std, axis=-1),
(bias_atom_e["property"].shape[0], 1),
)
}

return bias_atom_e, std_atom_e

Expand Down
2 changes: 1 addition & 1 deletion deepmd/utils/argcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ def loss_property():
optional=True,
default=1.00,
doc=doc_beta,
)
),
]


Expand Down

0 comments on commit c0f09e6

Please sign in to comment.