peal.architectures.module_blocks.TransformerBlock¶
- class peal.architectures.module_blocks.TransformerBlock[source]¶
Bases:
SequentialPre-activation transformer block: attention and position-wise MLP, each residual.
Sub-block 1 is
SkipConnection(SelfAttentionLayer -> LayerNorm); sub-block 2 isSkipConnection(1x1 Conv1d over the embedding axis -> activation -> LayerNorm). Inputs and outputs have shape(B, T, embedding_dim).- Parameters:
Methods