You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand correctly, the large_inter, large_union, small_inter, small_union returned by run_epoch() are lists, with a length equal to the number of dataset items. To output one (large, small or overall) DICE value for the whole epoch, it would be reasonable to take the average (large, small or overall) DICE accross dataset items. However, the above code does something different: It sums the enumerators separately, sums the denominators separately, and then divides them.
This is not equal to averaging the individual DICE scores.
Was it done this way intentionally?
The text was updated successfully, but these errors were encountered:
In segmentation.py:
https://github.com/echonet/dynamic/blob/master/echonet/utils/segmentation.py
, lines #175-#178, there are the following 4 lines of code:
loss, large_inter, large_union, small_inter, small_union = echonet.utils.segmentation.run_epoch(model, dataloader, phase == "train", optim, device)
overall_dice = 2 * (large_inter.sum() + small_inter.sum()) / (large_union.sum() + large_inter.sum() + small_union.sum() + small_inter.sum())
large_dice = 2 * large_inter.sum() / (large_union.sum() + large_inter.sum())
small_dice = 2 * small_inter.sum() / (small_union.sum() + small_inter.sum())
If I understand correctly, the large_inter, large_union, small_inter, small_union returned by run_epoch() are lists, with a length equal to the number of dataset items. To output one (large, small or overall) DICE value for the whole epoch, it would be reasonable to take the average (large, small or overall) DICE accross dataset items. However, the above code does something different: It sums the enumerators separately, sums the denominators separately, and then divides them.
This is not equal to averaging the individual DICE scores.
Was it done this way intentionally?
The text was updated successfully, but these errors were encountered: