Skip to content

Questions about mask usage in convolution #13

@antao97

Description

@antao97

Hi,

Thanks for your great work!

I have some questions about the mask usage in your convolution operation. I'm wondering what is the meaning to assign conv_module.__mask__ with mask. I checked that the conv_module(x) function does not consider the conv_module.__mask__ property when operating.

def conv1x1(conv_module, x, mask, fast=False):
w = conv_module.weight.data
mask.flops_per_position += w.shape[0]*w.shape[1]
conv_module.__mask__ = mask
return conv_module(x)

Therefore, I can't get how the masks are applied in network forward propagation, such as the basicblock in

x = dynconv.conv3x3(self.conv1, x, None, mask_dilate)
x = dynconv.bn_relu(self.bn1, self.relu, x, mask_dilate)
x = dynconv.conv3x3(self.conv2, x, mask_dilate, mask)
x = dynconv.bn_relu(self.bn2, None, x, mask)
out = identity + dynconv.apply_mask(x, mask)

It seems that only the mask in dynconv.apply_mask(x, mask) works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions