Skip to content

Commit

Permalink
fix:UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
anyangml committed Apr 7, 2024
1 parent a3ca59e commit 33b33be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepmd/pt/model/atomic_model/linear_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def forward_atomic(
mapping,
fparam,
aparam,
)["energy"]
)
# apply bias to each individual model
ener_list.append(model.apply_out_stat(raw_ret, mapping[extended_atype]))
ener_list.append(model.apply_out_stat(raw_ret, mapping[extended_atype][:,:nloc])["energy"])
weights = self._compute_weight(extended_coord, extended_atype, nlists_)

fit_ret = {
Expand Down
4 changes: 4 additions & 0 deletions deepmd/pt/model/model/make_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ def forward_common(
model_predict = self.output_type_cast(model_predict, input_prec)
return model_predict

@property
def out_bias(self)-> torch.Tensor:
return self.atomic_model.out_bias

def change_out_bias(
self,
merged,
Expand Down

0 comments on commit 33b33be

Please sign in to comment.