meddlr.metrics.functional.dice#

meddlr.metrics.functional.dice(y_pred, y_true)#

Computes dice score coefficient.

Parameters
  • y_pred (torch.Tensor) – Predicted categorical segmentation. Expected shape: (B, C, H, ...).

  • y_true (torch.Tensor) – Ground truth categorical segmentation. Expected shape: (B, C, H, ...).

Returns

Dice score. Shape: (B, C).

Return type

torch.Tensor