MCPcopy Create free account
hub / github.com/RolandGao/RegSeg / AttentionRefinementModule

Class AttentionRefinementModule

competitor_blocks.py:84–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 x= self.se(x)+x
83 return x
84class AttentionRefinementModule(nn.Module):
85 def __init__(self, in_chan, out_chan):
86 super(AttentionRefinementModule, self).__init__()
87 self.conv=ConvBnAct(in_chan,out_chan,3,1,1)
88 self.scale = nn.Sequential(
89 nn.AdaptiveAvgPool2d(1),
90 nn.Conv2d(out_chan, out_chan, 1, bias=False),
91 nn.BatchNorm2d(out_chan),
92 nn.Sigmoid(),
93 )
94
95 def forward(self, x):
96 x = self.conv(x)
97 atten=self.scale(x)
98 x=x*atten
99 return x
100class FeatureSelectionModule(nn.Module):
101 # FaPN paper
102 def __init__(self, in_chan, out_chan):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected