cbam_cnn_architectures_image_classification
cbam_cnn_architectures_image_classification copied to clipboard
Question regarding channel attention module.
Hello there!
I was looking at VGG16 with CBAM.
From the forward function, I see the following lines of codes
def forward(self,x):
x = self.features_1(x)
scale = torch.nn.functional.sigmoid(self.max_pool_1(x) + self.avg_pool_1(x)).expand_as(x)
x = x * scale
scale = torch.cat((torch.max(x, 1)[0].unsqueeze(1), torch.mean(x, 1).unsqueeze(1)), dim=1)
scale = self.spatial_attention(scale)
x = x * scale

I do not see shared MLP part of the code. I see that you get the maxpool and average pool of the input feature but you added sigmoid right away on top of shared MLP.
Can you explain where the shared MLP part is in the lines of codes of the forward function?
Thank you in advanced :).