dltk.core package

dltk.core.metrics module

dltk.core.metrics.abs_vol_difference(pred, labels, num_classes)[source]

Calculates the average volume difference of labels and predictions per class

Parameters:
  • pred (np.ndarray) – predictions
  • labels (np.ndarray) – labels
  • num_classes (int) – number of classes to calculate avd for
Returns:

avd per class

Return type:

np.ndarray

dltk.core.metrics.crossentropy(pred, labels, logits=True)[source]

Calculates the crossentropy loss between prediction and labels

Parameters:
  • pred (np.ndarray) – prediction of the system
  • labels (np.ndarray) – labels
  • logits (bool) – flag whether pred are logits or probabilities
Returns:

crossentropy error

Return type:

float

dltk.core.metrics.dice(pred, labels, num_classes)[source]

Calculates the dice score of labels and predictions

Parameters:
  • pred (np.ndarray) – predictions
  • labels (np.ndarray) – labels
  • num_classes (int) – number of classes to calculate avd for
Returns:

dice per class

Return type:

np.ndarray

Module contents