(self, channels, reduction=16, kernel_size=7)
| 178 | |
| 179 | class CBAM(nn.Module): |
| 180 | def __init__(self, channels, reduction=16, kernel_size=7): |
| 181 | super().__init__() |
| 182 | self.channel_attention = SqueezeExcitation(channels, reduction) |
| 183 | self.spatial_attention = SpatialAttention(kernel_size) |
| 184 | |
| 185 | def forward(self, x): |
| 186 | x = self.channel_attention(x) |