AttentionModule¶
tiatoolbox.models.architecture.utils.AttentionModule
- class AttentionModule(name, in_channels, reduction=16)[source]¶
Attention module to apply attention mechanism on feature maps.
Initialize the Attention module.
- Parameters:
Methods
Forward pass of the Attention module.
Attributes
training- forward(x)[source]¶
Forward pass of the Attention module.
- Parameters:
x (torch.Tensor) – Input feature map of shape (N, C, H, W).
self (AttentionModule)
- Returns:
Output feature map after applying attention.
- Return type: