STDC-Seg icon indicating copy to clipboard operation
STDC-Seg copied to clipboard

dice loss 实现分母为什么没有平方?

Open GondorFu opened this issue 4 years ago • 1 comments

def dice_loss_func(input, target): smooth = 1. n = input.size(0) iflat = input.view(n, -1) tflat = target.view(n, -1) intersection = (iflat * tflat).sum(1) loss = 1 - ((2. * intersection + smooth) / (iflat.sum(1) + tflat.sum(1) + smooth)) return loss.mean()

dice loss 实现分母为什么没有平方?

这里实现是不是有问题

GondorFu avatar Aug 20 '21 09:08 GondorFu

def dice_loss_func(input, target): smooth = 1. n = input.size(0) iflat = input.view(n, -1) tflat = target.view(n, -1) intersection = (iflat * tflat).sum(1) loss = 1 - ((2. * intersection + smooth) / (iflat.sum(1) + tflat.sum(1) + smooth)) return loss.mean()

dice loss 实现分母为什么没有平方?

这里实现是不是有问题

这个我去搜的dice loss相关博客,上面说的可以是平方,也可以直接逐元素相加

MyFirst905 avatar Dec 11 '22 12:12 MyFirst905