Skip to content

Commit

Permalink
Update loss.py
Browse files Browse the repository at this point in the history
align unit
  • Loading branch information
floatingCatty authored Dec 31, 2024
1 parent 46c6aa7 commit 24c6afe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dptb/nnops/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def __init__(
self.device = device
self.onsite_shift = onsite_shift
self.coeff_ham = coeff_ham
assert self.coeff_ham <= 1.
self.coeff_ovp = coeff_ovp

if basis is not None:
Expand Down Expand Up @@ -393,7 +394,7 @@ def forward(self, data: AtomicDataDict, ref_data: AtomicDataDict):

eigloss = self.eigloss(data, ref_data)

return self.coeff_ham * ham_loss + eigloss
return self.coeff_ham * ham_loss + (1 - self.coeff_ham) eigloss



Expand Down Expand Up @@ -1106,4 +1107,4 @@ def __cal_norm__(self, irreps: Irreps, x: torch.Tensor):
tensor = tensor.norm(dim=-1)
out.append(tensor)

return torch.cat(out, dim=-1).squeeze(0)
return torch.cat(out, dim=-1).squeeze(0)

0 comments on commit 24c6afe

Please sign in to comment.