ZhenZHAO / AD-MT

[ECCV'24] Alternate Diverse Teaching for Semi-supervised Medical Image Segmentation
https://arxiv.org/abs/2311.17325
19 stars 0 forks source link

Code implementation doesn't match with paper #1

Closed CannotBeFatAnyMore closed 9 months ago

CannotBeFatAnyMore commented 9 months ago

Thanks for your great work, during my running process based on your code, i found that "code/train_post_3d_aut.py" has a confusing operation: In row 232-235: You first add up entropy_1 with entropy_2 before exp operation. weighted_entropy = entropy_1 + entropy_2 But in your arXiv paper, as depicted in Eq.8 and Eq.9, which should be reimplemented as : w1 = torch.exp(-entropy_1) w2 = torch.exp(-entropy_2) So the final output_predict should be: weighted_outputs = (w1* ema_outputs_soft_1+w2* ema_outputs_soft_2)/(w1+w2)

Is there anywhere i didn't correctly understand? Please figure it out. Thanks <^_^>!

ZhenZHAO commented 9 months ago

yes. seems I uploaded the previous code. it should be sth like,

weights_1 = torch.exp(-entropy_1) / (torch.exp(-entropy_1) + torch.exp(-entropy_2)) weights_2 = 1.0 - weights_1 weighted_outputs = weights_1.unsqueeze(1) ema_outputs_soft_1 + weights_2.unsqueeze(1) ema_outputs_soft_2

I will update the code and double check it when I am free.

cheers

发自我的手机

-------- 原始邮件 -------- 发件人: JM Xu @.> 日期: 2023年12月19日周二 下午3:57 收件人: ZhenZHAO/AD-MT @.> 抄送: Subscribed @.***> 主 题: [ZhenZHAO/AD-MT] Code implementation doesn't match with paper (Issue #1)

Thanks for your great work, during my running process based on your code, i found that "code/train_post_3d_aut.py" has a confusing operation: In row 232-235: You first add up entropy_1 with entropy_2 before exp operation. But in your arXiv paper, as depicted in Eq.8 and Eq.9, which should be reimplemented as : w1 = torch.exp(-entropy_1) w2 = torch.exp(-entropy_2) So the final output_predict should be: weighted_outputs = (w1 ema_outputs_soft_1+w2 ema_outputs_soft_2)/(w1+w2)

Is there anywhere i didn't correctly understand? Please figure it out. Thanks <^_^>!

— Reply to this email directly, view it on GitHubhttps://github.com/ZhenZHAO/AD-MT/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADI6IEM5IZOE53F7Z55PKWDYKFCHFAVCNFSM6AAAAABA2XQCZ2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DQMJRHE3DGMI. You are receiving this because you are subscribed to this thread.Message ID: @.***>