(self, fms_high, fms_low, fm_mask=None)
return out
Use the high level features with abundant catagory information to weight the low level features with pixel
        localization information. In the meantime, we further use mask feature maps with catagory-specific information
        to localize the mask position.
        :param fms_high: Features of high level. Tensor.
        :param fms_low: Features of low level.  Tensor.
        :param fm_mask:
        :return: fms_att_upsample
Use the high level features with abundant catagory information to weight the low level features with pixel
        localization information. In the meantime, we further use mask feature maps with catagory-specific information
        to localize the mask position.
        :param fms_high: Features of high level. Tensor.
        :param fms_low: Features of low level.  Tensor.
        :param fm_mask:
        :return: fms_att_upsample
Use the high level features with abundant catagory information to weight the low level features with pixel localization information . In the meantime we further use mask feature maps with catagory - specific information to localize the mask position . : param fms_high : Features of high level . Tensor . : param fms_low : Features of low level . Tensor . : param fm_mask : : return : fms_att_upsample
def forward(self, fms_high, fms_low, fm_mask=None):
        """
        Use the high level features with abundant catagory information to weight the low level features with pixel
        localization information. In the meantime, we further use mask feature maps with catagory-specific information
        to localize the mask position.
        :param fms_high: Features of high level. Tensor.
        :param fms_low: Features of low level.  Tensor.
        :param fm_mask:
        :return: fms_att_upsample
        """
        b, c, h, w = fms_high.shape

        fms_high_gp = nn.AvgPool2d(fms_high.shape[2:])(fms_high).view(len(fms_high), c, 1, 1)
        fms_high_gp = self.conv1x1(fms_high_gp)
        # fms_high_gp = self.bn_high(fms_high_gp)# arlog, when the spatial size HxW = 1x1, the BN cannot be used.
        fms_high_gp = self.relu(fms_high_gp)

        # fms_low_mask = torch.cat([fms_low, fm_mask], dim=1)
        fms_low_mask = self.conv3x3(fms_low)
        fms_low_mask = self.bn_low(fms_low_mask)

        fms_att = fms_low_mask * fms_high_gp
        if self.upsample:
            out = self.relu(
                self.bn_upsample(self.conv_upsample(fms_high)) + fms_att)
        else:
            out = self.relu(
                self.bn_reduction(self.conv_reduction(fms_high)) + fms_att)
        return out
def forward ( self , fms_high , fms_low , fm_mask = None ) : b , c , h , w = fms_high . shape fms_high_gp = nn . AvgPool2d ( fms_high . shape [ 2 : ] ) ( fms_high ) . view ( len ( fms_high ) , c , 1 , 1 ) fms_high_gp = self . conv1x1 ( fms_high_gp ) # fms_high_gp = self.bn_high(fms_high_gp)# arlog, when the spatial size HxW = 1x1, the BN cannot be used. fms_high_gp = self . relu ( fms_high_gp ) # fms_low_mask = torch.cat([fms_low, fm_mask], dim=1) fms_low_mask = self . conv3x3 ( fms_low ) fms_low_mask = self . bn_low ( fms_low_mask ) fms_att = fms_low_mask * fms_high_gp if self . upsample : out = self . relu ( self . bn_upsample ( self . conv_upsample ( fms_high ) ) + fms_att ) else : out = self . relu ( self . bn_reduction ( self . conv_reduction ( fms_high ) ) + fms_att ) return out