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

[BUG] residual connection wrong? #32

Closed
qianlong0502 opened this issue Mar 4, 2024 · 1 comment
Closed

[BUG] residual connection wrong? #32

qianlong0502 opened this issue Mar 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@qianlong0502
Copy link

qianlong0502 commented Mar 4, 2024

In bit_transformer.py:

class Transformer(nn.Module):
    def forward(self, x: Tensor, *args, **kwargs) -> Tensor:
        for attn, ffn in zip(self.layers, self.ffn_layers):
            # print(x.shape)
            x, _ = attn(x, x, x, is_causal=True, *args, **kwargs)
            x = x + x
            x = ffn(x) + x
        return x

Is the line x = x + x wrong? This seems not a residual connection.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@qianlong0502 qianlong0502 added the bug Something isn't working label Mar 4, 2024
@kyegomez
Copy link
Owner

kyegomez commented Mar 4, 2024

@qianlong0502 fixed it now excuse me, thanks for the catch!

@kyegomez kyegomez closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants