Algorithms 7 and 8 of the Supplementary Information to Jumper et al. (2021), pp. 15-16. The row-wise form attends over residues within one sequence and adds a bias read off the pair representation, which is how the pair stack speaks back to the MSA stack. The column-wise form attends over sequences at a fixed residue and carries no pair bias.
Arguments
- m
MSA representation, an
s x n x cmarray.- wq, wk, wv, wg
Lists of per-head projection matrices, each
c x cm.- wo
Output projection,
cm x (nhead * c).- z
Pair representation
n x n x cz; required when mode is "row".- wb
Per-head pair-bias projection
nhead x cz; required when mode is "row" (line 3 of Algorithm 7).- mode
Either "row" (Algorithm 7) or "column" (Algorithm 8).
