Skip to content

Transformer forward changes #43

Description

@ZFTurbo

Now forward is like that

def forward(self, x, value_residual = None):
    first_values = None
    for attn, ff in self.layers:
        x, next_values = attn(x, value_residual = value_residual)
        first_values = default(first_values, next_values)
        x = ff(x)

    return self.norm(x), first_values

vs before:

def forward(self, x):

        for attn, ff in self.layers:
            x = attn(x) + x
            x = ff(x) + x

        return self.norm(x)

It broke compatibility with old weights. Was it made intentionally? Is it needed for value residual learning and hyper connections?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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