Skip to content

Should encoder mask be a (1, seq_len, seq_len) matrix? #30

@scotthuang1989

Description

@scotthuang1989

If input sentence is (A, B, C, D, PAD).
In this implementation, encoder mask is [[[FALSE, FALSE, FALSE, TRUE]]]
But the encoder attention is
[
[AA, AB, AC, AD],
[BA, BB, BC, BD],
[CA, CB, CC, CD],
[DA, DB, DC, DD]
]
This encoder mask will only mask the 4th colomn. 4th row should also be mask?
So encoder mask should be

[[
[FALSE, FALSE, FALSE, TRUE]
[FALSE, FALSE, FALSE, TRUE]
[FALSE, FALSE, FALSE, TRUE]
[TRUE, TRUE, TRUE, TRUE]
]
]

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