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

Class FeatureSelectionModule

competitor_blocks.py:100–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 x=x*atten
99 return x
100class FeatureSelectionModule(nn.Module):
101 # FaPN paper
102 def __init__(self, in_chan, out_chan):
103 super(FeatureSelectionModule, self).__init__()
104 self.conv_atten=nn.Sequential(
105 nn.AdaptiveAvgPool2d(1),
106 nn.Conv2d(in_chan, in_chan, kernel_size=1, bias=False),
107 nn.Sigmoid()
108 )
109 self.conv = nn.Conv2d(in_chan, out_chan, kernel_size=1, bias=False)
110
111 def forward(self, x):
112 x = x*self.conv_atten(x) + x
113 x = self.conv(x)
114 return x
115
116class DeformConv(nn.Module):
117 def __init__(self,in_channels, out_channels, kernel_size, stride, padding, dilation=1, deformable_groups=1):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected