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

how absolute position embedding is applied? #188

Open zhouzhengbo2022 opened 1 year ago

zhouzhengbo2022 commented 1 year ago

Thanks author for this great project. I have a question about how absolute position embedding is applied as shown in the code

self.pos_embed = nn.Parameter(torch.zeros(1, channels, 14, 14))

https://github.com/huawei-noah/Efficient-AI-Backbones/blob/master/vig_pytorch/vig.py#L110

since it is initialized as zero and have not updated during the training.

iamhankai commented 1 year ago

It is used in https://github.com/huawei-noah/Efficient-AI-Backbones/blob/9172762a38e9bcafab9907c93ca7141797386f4c/vig_pytorch/vig.py#L140

It will be updated during training.