Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#217·attention-is-all-you-need-pytorch

About target mask

Author: KimRassCreated Jan 21, 2024Updated Jan 21, 2024

https://github.com/jadore801120/attention-is-all-you-need-pytorch/blob/master/transformer/Models.py#L190

I think that should be like

python
trg_mask = get_pad_mask(trg_seq, self.trg_pad_idx) | get_subsequent_mask(trg_seq)

am I wrong?

Source: jadore801120/attention-is-all-you-need-pytorch

View original on GitHubView discussion on GitHub