Skip to content

Question about residual connection #8

@anxietymonger

Description

@anxietymonger

Got here from this article.

Firstly thank you so much about your work, giving insight for time series analysis beginners like me.

However, in the definition of TransformerEncoder, I found in forward() function, the residual connection is defined like this:

ff_layer = self.ff_normalize(x[0] + ff_layer)

According to the original paper (Attention is all you need), the residual connection should be defined in this way:

ff_layer = self.ff_normalize(attn_layer + ff_layer)

Any possibility that you could provide more explanation about the intuition behind this discrepancy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions