MultiHeadAttention
Record fields
| Name | Description |
|---|
HeadDim | |
NumHeads | |
WK | |
WO | |
WQ | |
WV | |
Instance members
| Name | Description |
|---|
this.forward (x, ?mask, ?kvCache) | |
Pre-norm transformer block: Norm → Attn → Add → Norm → FFN → Add.
Record fields
| Name | Description |
|---|
Attn | |
AttnNorm | |
Ff1 | |
Ff2 | |
FfNorm | |
Instance members
| Name | Description |
|---|
this.forward (x, ?mask) | |
PostNormTransformerBlock
Post-norm transformer block: Attn → Add → Norm → FFN → Add → Norm.
Record fields
| Name | Description |
|---|
Attn | |
AttnNorm | |
Ff1 | |
Ff2 | |
FfNorm | |
Instance members
| Name | Description |
|---|
this.forward (x, ?mask) | x←LN(x+Attn(x)), then x←LN(x+FFN(x)). |