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))
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))