Skip to content

Commit

Permalink
Merge pull request #110 from luigibonati/bug_unrepresented_state
Browse files Browse the repository at this point in the history
Fix bug unrepresented state in TDA loss
  • Loading branch information
EnricoTrizio committed Dec 22, 2023
2 parents 80824cf + dbac2c1 commit 9e35e07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlcolvar/core/loss/tda_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def tda_loss(

for i in range(n_states):
# check which elements belong to class i
if not torch.nonzero(labels == i).any():
if not (labels == i).any():
raise ValueError(
f"State {i} was not represented in this batch! Either use bigger batch_size or a more equilibrated dataset composition!"
)
Expand Down

0 comments on commit 9e35e07

Please sign in to comment.