huawei-noah / Efficient-AI-Backbones

Efficient AI Backbones including GhostNet, TNT and MLP, developed by Huawei Noah's Ark Lab.
4.07k stars 708 forks source link

the meaning of max_dilation in vig #128

Closed buptxiaofeng closed 2 years ago

buptxiaofeng commented 2 years ago

Hi, thanks for sharing this impressive work. I have a question regarding the max_dilation in the class DeepGCN. The codes are shown as following. What's the meaning of the number 49 when calculating max_dilation?

    blocks = opt.blocks
    self.n_blocks = sum(blocks)
    channels = opt.channels
    reduce_ratios = [4, 2, 1, 1]
    dpr = [x.item() for x in torch.linspace(0, drop_path, self.n_blocks)]  # stochastic depth decay rule 
    num_knn = [int(x.item()) for x in torch.linspace(k, k, self.n_blocks)]  # number of knn's k
    max_dilation = 49 // max(num_knn)

    self.stem = Stem(out_dim=channels[0], act=act)
    self.pos_embed = nn.Parameter(torch.zeros(1, channels[0], 224//4, 224//4))
    HW = 224 // 4 * 224 // 4 
iamhankai commented 2 years ago

The number 49 (i.e., 7x7) means the number of nodes in the last stage. max_dilation is used to constrain dilation operation not to exceed the number of nodes. See the details of dilation based GCN in paper: https://arxiv.org/abs/1904.03751