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

def init_out_stat(self):
"""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)

# 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(
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)
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)
Expand Down

0 comments on commit 4c038d8

Please sign in to comment.