Skip to content

Commit

Permalink
oops, adaln zero never has bias
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed May 13, 2024
1 parent a40bfed commit 4c3979d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions alphafold3_pytorch/alphafold3.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ def __init__(
*,
dim,
dim_cond,
adaln_zero_bias_init_value = -2.,
adaln_zero_has_bias = True
adaln_zero_bias_init_value = -2.
):
super().__init__()
self.fn = fn
Expand All @@ -155,11 +154,6 @@ def __init__(
nn.Sigmoid()
)

self.adaln_zero_has_bias = adaln_zero_has_bias

if adaln_zero_has_bias:
self.to_adaln_zero_beta = nn.Linear(dim_cond, dim, bias = False)

@typecheck
def forward(
self,
Expand All @@ -173,13 +167,7 @@ def forward(
out = self.fn(x, **kwargs)

gamma = self.to_adaln_zero_gamma(cond)
out = out * gamma

if not self.adaln_zero_has_bias:
return

beta = self.to_adaln_zero_beta(cond)
return out + beta
return out * gamma

# triangle multiplicative module
# seems to be unchanged from alphafold2
Expand Down

0 comments on commit 4c3979d

Please sign in to comment.