Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove zero initialization of to_attn_bias weights, since for these bias=False #302

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions alphafold3_pytorch/alphafold3.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,8 @@ def __init__(self, *, heads, dim_pairwise, window_size=None, num_memory_kv=0, **

# line 8 of Algorithm 24

to_attn_bias_linear = LinearNoBias(dim_pairwise, heads)
nn.init.zeros_(to_attn_bias_linear.weight)

self.to_attn_bias_norm = nn.LayerNorm(dim_pairwise)
self.to_attn_bias = nn.Sequential(to_attn_bias_linear, Rearrange("b ... h -> b h ..."))
self.to_attn_bias = nn.Sequential(LinearNoBias(dim_pairwise, heads), Rearrange("b ... h -> b h ..."))

@typecheck
def forward(
Expand Down