peal.architectures.basic_modules¶
Small nn.Module building blocks used by PEAL’s configurable architectures.
The predictor and generator builders in peal.architectures assemble
networks from layer lists; these modules wrap tensor operations (transpose,
squeeze, mean, one-hot) so they can appear in nn.Sequential, plus a
zennit-friendly residual block and a few attention layers with hand-rolled
positional encodings for sequence and image inputs.
Classes
Cross-attention that maps a spatial feature map to |
|
Self-attention over the spatial positions of an image feature map. |
|
Average over a set of dimensions (global average pooling by default). |
|
One-hot encode integer inputs that arrive as a 2D tensor. |
|
Multi-head self-attention over a |
|
Residual block |
|
Remove singleton dimensions, one |
|
Module form of |
|
Insert singleton dimensions, one |