jeya-maria-jose / UNeXt-pytorch

Official Pytorch Code base for "UNeXt: MLP-based Rapid Medical Image Segmentation Network", MICCAI 2022
https://jeya-maria-jose.github.io/UNext-web/
MIT License
459 stars 76 forks source link

torch.add in Unext module? #9

Closed Capchenxi closed 2 years ago

Capchenxi commented 2 years ago

Hello, I saw in the source code, you used torch.cat() to combine the downsampled features with the upsampled features? Is any specific reason for that operation? Is it because using torch.add() has less operations than torch.concate() when the network process forward? Since I remember in unet the downsampled features and the upsampled features are concatenated together rather than add. Thanks.

jeya-maria-jose commented 2 years ago

Hi, yeah, using add reduces complexity. Addition can be considered as non weighted concatenation. Please check this out: https://stats.stackexchange.com/questions/361018/when-to-add-layers-and-when-to-concatenate-in-neural-networks

Capchenxi commented 2 years ago

Hi, yeah, using add reduces complexity. Addition can be considered as non weighted concatenation. Please check this out: https://stats.stackexchange.com/questions/361018/when-to-add-layers-and-when-to-concatenate-in-neural-networks

Thanks for your prompt reply. That makes sense to me.