asdf2kr / BAM-CBAM-pytorch

Pytorch implementation of BAM("BAM: Bottleneck Attention Module", BMVC18) and CBAM(“CBAM: Convolutional Block Attention Module”, ECCV18)
MIT License
31 stars 4 forks source link

Something wrong with code in attention.py #1

Open harudaee opened 4 years ago

harudaee commented 4 years ago

Excuse me, sir.

I read your file 'attention.py' and I find something wrong. In line 62, there is 'return x + (x * Mf)'.

According to the Eq.(2). in paper BAM: Bottleneck Attention Module, it should be 'return x * Mf' .

Because in the .py file, you have defined 'Mf = 1 + self.sigmoid(Mc * Ms)'.

asdf2kr commented 4 years ago

Thanks,

I use 'return x * Mf', but the code has not been modified at this time.

I will update the new code as soon as possible.

Thank U, sir.

-----Original Message----- From: "harudaee"notifications@github.com To: "asdf2kr/BAM-CBAM-pytorch"BAM-CBAM-pytorch@noreply.github.com; Cc: "Subscribed"subscribed@noreply.github.com; Sent: 2019-11-12 (화) 23:18:06 (GMT+09:00) Subject: [asdf2kr/BAM-CBAM-pytorch] Something wrong with code in attention.py (#1)

Excuse me, sir. I read your file 'attention.py' and I find something wrong. In line 62, there is 'return x + (x Mf)'. According to the Eq.(2). in paper BAM: Bottleneck Attention Module, it should be 'return x Mf' . Because in the .py file, you have defined 'Mf = 1 + self.sigmoid(Mc * Ms)'. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Rvv1296 commented 2 years ago

Hello sir, I want to add this CBAM block in the YOLOv4 object detection model. Can you please give some idea how I can proceed with it, it will help me a lot. Thank you in advance !!

asdf2kr commented 2 years ago

@Rvv1296 Please check the darknet repository for this issue

Tang-08080103 commented 1 year ago

Excuse me, sir.

I read your file 'attention.py' and I find something wrong. In line 62, there is 'return x + (x * Mf)'.

According to the Eq.(2). in paper BAM: Bottleneck Attention Module, it should be 'return x * Mf' .

Because in the .py file, you have defined 'Mf = 1 + self.sigmoid(Mc * Ms)'.

Why Mf = 1 + self.sigmoid(Mc * Ms) instead of Mf = 1 + self.sigmoid(Mc + Ms), and where can I find an introduction to it