Skip to content

Commit

Permalink
solve name conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Han Wang committed Apr 6, 2024
1 parent 48ee272 commit 4c038d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions deepmd/pt/model/atomic_model/base_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
self.reinit_atom_exclude(atom_exclude_types)
self.reinit_pair_exclude(pair_exclude_types)
self.rcond = rcond
self.atom_ener = preset_out_bias
self.preset_out_bias = preset_out_bias

Check warning on line 82 in deepmd/pt/model/atomic_model/base_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/base_atomic_model.py#L81-L82

Added lines #L81 - L82 were not covered by tests

def init_out_stat(self):

Check warning on line 84 in deepmd/pt/model/atomic_model/base_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/base_atomic_model.py#L84

Added line #L84 was not covered by tests
"""Initialize the output bias."""
Expand Down Expand Up @@ -235,7 +235,7 @@ def forward_common_atomic(
fparam=fparam,
aparam=aparam,
)
ret_dict = self.apply_out_bias(ret_dict, atype)
ret_dict = self.apply_out_stat(ret_dict, atype)

Check warning on line 238 in deepmd/pt/model/atomic_model/base_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/base_atomic_model.py#L238

Added line #L238 was not covered by tests

# nf x nloc
atom_mask = ext_atom_mask[:, :nloc].to(torch.int32)
Expand Down Expand Up @@ -308,12 +308,12 @@ def compute_or_load_out_stat(
bias_adjust_mode="set-by-statistic",
)

def apply_out_bias(
def apply_out_stat(

Check warning on line 311 in deepmd/pt/model/atomic_model/base_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/base_atomic_model.py#L311

Added line #L311 was not covered by tests
self,
ret: Dict[str, torch.Tensor],
atype: torch.Tensor,
):
"""Apply the bias to each atomic output.
"""Apply the stat to each atomic output.
The developer may override the method to define how the bias is applied
to the atomic output of the model.
Expand Down Expand Up @@ -362,7 +362,7 @@ def change_out_bias(
stat_file_path=stat_file_path,
model_forward=self._get_forward_wrapper_func(),
rcond=self.rcond,
preset_bias=self.atom_ener,
preset_bias=self.preset_out_bias,
)
# self.set_out_bias(delta_bias, add=True)
self._store_out_stat(delta_bias, out_std, add=True)

Check warning on line 368 in deepmd/pt/model/atomic_model/base_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/base_atomic_model.py#L368

Added line #L368 was not covered by tests
Expand All @@ -373,7 +373,7 @@ def change_out_bias(
keys=list(self.atomic_output_def().keys()),
stat_file_path=stat_file_path,
rcond=self.rcond,
preset_bias=self.atom_ener,
preset_bias=self.preset_out_bias,
)
# self.set_out_bias(bias_out)
self._store_out_stat(bias_out, std_out)

Check warning on line 379 in deepmd/pt/model/atomic_model/base_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/base_atomic_model.py#L379

Added line #L379 was not covered by tests
Expand Down

0 comments on commit 4c038d8

Please sign in to comment.