mr2.nn.attention

Attention modules.

Classes

AttentionGate

Attention gate from Attention UNet.

ConvolutionalAttention

Temporal or patch attention with spatial convolutional projections.

LinearSelfAttention

Linear multi-head self-attention via kernel trick.

NeighborhoodSelfAttention

Attention where each query attends to a neighborhood of the key and value.

ShiftedWindowAttention

Shifted Window Attention.

SpatialTransformerBlock

Spatial transformer block.

SqueezeExcitation

Squeeze-and-Excitation block.

TransposedAttention

Transposed Self Attention from Restormer.