(self, in_chan, out_chan)
| 100 | class 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 |