yulequan / UA-MT

code for MICCAI 2019 paper 'Uncertainty-aware Self-ensembling Model for Semi-supervised 3D Left Atrium Segmentation'.
https://arxiv.org/abs/1907.07034
477 stars 97 forks source link

A small code detail problem #7

Closed chuxiang93 closed 4 years ago

chuxiang93 commented 4 years ago

Hi, @yulequan Thank you for opening the source code, I viewed the code carefully and had a small question. consistency_dist = torch.sum(mask*consistency_dist)/(2*torch.sum(mask)+1e-16) consistency_loss = consistency_weight * consistency_dist loss = supervised_loss + consistency_loss You can see that, in calculating consistency_dist, the sum of mask needs to be multiplied by 2. I'm curious why do you multiply this by 2 here?

Looking forward to your reply. Best, Jianqiang Ma

yulequan commented 4 years ago

We produce two channels for the prediction (foreground and background). Meanwhile, the mask is only one channel.

chuxiang93 commented 4 years ago

OK, I got it. Thank you.

18677064404 commented 2 years ago

Hi, Thanks for your great work! For a 5 classes task, could you tell me the number in front of "mask" should be 2 or 5 for a 5 classes task.

consistency_dist = torch.sum(maskconsistency_dist)/(2torch.sum(mask)+1e-16) consistency_loss = consistency_weight * consistency_dist loss = supervised_loss + consistency_loss

Best.

yulequan commented 2 years ago

It should be 5.

18677064404 commented 2 years ago

Thans for your reply!

------------------ 原始邮件 ------------------ 发件人: "yulequan/UA-MT" @.>; 发送时间: 2022年3月12日(星期六) 下午4:36 @.>; @.**@.>; 主题: Re: [yulequan/UA-MT] A small code detail problem (#7)

It should be 5.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>