Skip to content

Commit

Permalink
make format
Browse files Browse the repository at this point in the history
  • Loading branch information
matsen committed Oct 16, 2024
1 parent bde7e47 commit 372ccee
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions netam/dasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,10 @@ def to(self, device):


def zap_predictions_along_diagonal(predictions, aa_parents_idxs):
"""Zero out the diagonal of a batch of predictions.
We do this so that we can sum then have the same type of predictions as for the
DNSM.
"""
# We would like to do
# predictions[torch.arange(len(aa_parents_idxs)), aa_parents_idxs] = 0.0
"""Set the diagonal (i.e. no amino acid change) of the predictions tensor to
-BIG."""
# This is effectively
# predictions[torch.arange(len(aa_parents_idxs)), aa_parents_idxs] = -BIG
# but we have a batch dimension. Thus the following.

batch_size, L, _ = predictions.shape
Expand Down

0 comments on commit 372ccee

Please sign in to comment.