MIC-DKFZ / BraTS2017

Apache License 2.0
74 stars 16 forks source link

Why reshape the y_true and y_pred in the function soft_dice_per_img_in_batch #24

Closed yianzhongguo closed 5 years ago

yianzhongguo commented 5 years ago

@FabianIsensee Hi, sir. I have one question about the function soft_dice_per_img_in_batch. I find that in the function the y_true and y_pred are all reshaped into (2, 2097152,4) before the computation of dice_scores. Why do this transform and why not use the original shape (2128128*128, 4). It looks that the reshaping operation do not impact the result of dice_scores. Thank you!

FabianIsensee commented 5 years ago

Depends on how you do the tensor math. That version of the dice loss is quite old (it is the first version I ever wrote). There is plenty of ways to write that more elegantly. If you reformulate it to something else and the results are the same then that's fine, too ;-)

yianzhongguo commented 5 years ago

Thank you very much!