Hello sir,
The dice_loss implementation is as follows:
def dice_loss(score, target):
    target = target.float()
    smooth = 1e-5
    intersect = torch.sum(score * target)
    y_sum = torch.sum(target * target)
    z_sum = torch.sum(score * score)
    loss = (2 * intersect + smooth) / (z_sum + y_sum + smooth)
    loss = 1 - loss
    return loss




 ptrblck:

the inputs are not what I would expect.


As I explained earlier, the problem is about the targets. The targets are not in the form of 0 (background) and 1(foreground) as it should be in the case of binary segmentation. Instead, the values of the foreground are float values ranging from 0.1 to 1. After reading online, I found that it could also be seen as a regression problem rather than classification. I am yet to get a clear picture of everything given that I am a beginner. Please, any explanation and suggestions would be highly appreciated.