Ejemplo n.º 1
0
 def __call__(self, input, target):
     """
     :param input: 5D probability maps torch tensor (NxCxDxHxW)
     :param target: 4D or 5D ground truth torch tensor. 4D (NxDxHxW) tensor will be expanded to 5D as one-hot
     :return: Soft Dice Coefficient averaged over all channels/classes
     """
     # Average across channels in order to get the final score
     return torch.mean(compute_per_channel_dice(input, target, epsilon=self.epsilon, ignore_index=self.ignore_index))
Ejemplo n.º 2
0
 def __call__(self, input, target):
     # Average across channels in order to get the final score
     return torch.mean(
         compute_per_channel_dice(input, target, epsilon=self.epsilon))