mr2.nn.attention.TransposedAttention
- class mr2.nn.attention.TransposedAttention[source]
Bases:
ModuleTransposed Self Attention from Restormer.
Implements the transposed self-attention, i.e. channel-wise multihead self-attention, layer from Restormer [ZAM22].
References
[ZAM22]Zamir, Syed Waqas, et al. “Restormer: Efficient transformer for high-resolution image restoration.” CVPR 2022, https://arxiv.org/pdf/2111.09881.pdf
- __init__(n_dim: int, n_channels_in: int, n_channels_out: int, n_heads: int)[source]
Initialize a TransposedAttention layer.