Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in combine two channel step in BAM #52

Closed
mxmm2123 opened this issue Jan 21, 2024 · 0 comments
Closed

Issue in combine two channel step in BAM #52

mxmm2123 opened this issue Jan 21, 2024 · 0 comments

Comments

@mxmm2123
Copy link

Hi author, thank for good code. I confused in combine channel and spatial. In your paper before go to sigmoid func, you add two channel, but in code is multiply. Is it mistake?
image

class BAM(nn.Module):
    def __init__(self, gate_channel):
        super(BAM, self).__init__()
        self.channel_att = ChannelGate(gate_channel)
        self.spatial_att = SpatialGate(gate_channel)
    def forward(self,in_tensor):
        att = 1 + F.sigmoid( self.channel_att(in_tensor) * self.spatial_att(in_tensor) ) # multiply in here
        return att * in_tensor
@mxmm2123 mxmm2123 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant