Skip to content

Transformer forward changes #43

@ZFTurbo

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?

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