Skip to content

Commit

Permalink
properly mask for structure module
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Aug 23, 2021
1 parent dda22b5 commit c85682e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion alphafold2_pytorch/alphafold2.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def forward(self, x, mask = None):
if exists(mask):
# masked mean, if there are padding in the rows of the MSA
mask = rearrange(mask, 'b m i -> b m i () ()') * rearrange(mask, 'b m j -> b m () j ()')
outer = outer.masked_fill(mask, 0.)
outer = outer.masked_fill(~mask, 0.)
outer = outer.mean(dim = 1) / (mask.sum(dim = 1) + self.eps)
else:
outer = outer.mean(dim = 1)
Expand Down Expand Up @@ -860,6 +860,7 @@ def forward(

single_repr = self.ipa_block(
single_repr,
mask = mask,
pairwise_repr = pairwise_repr,
rotations = rotations,
translations = translations
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'alphafold2-pytorch',
packages = find_packages(),
version = '0.4.26',
version = '0.4.29',
license='MIT',
description = 'AlphaFold2 - Pytorch',
author = 'Phil Wang, Eric Alcaide',
Expand Down

0 comments on commit c85682e

Please sign in to comment.