Is your feature request related to a problem? Please describe.
The docstring descriptions for DiceLoss, DiceMetric, DiceHelper, and compute_dice should include more information about the expectations of inputs, implications of various arguments, and better examples. There's been some confusion about why results from the loss don't match expectations given the value of metrics, this is related to the extra features in the loss such as the smoothing values as well as misunderstanding about activation or thresholding/one-hot formatting.
Describe the solution you'd like
A few things should be changed or added:
- Docstring for
DiceMetric should make it clear the ground truth and prediction can be either single-channel label maps or multi-channel one-hot tensors.
- The values of the inputs do matter since no thresholding is done in the metrics themselves.
- The
softmax parameter of DiceHelper is confusing in that it appears to indicate softmax will be applied if it's true, rather than the expectation that this was already done to the prediction. This should be renamed to argmax and the old name deprecated. It should also be noted that this parameter becomes the opposite value to sigmoid if not given a value.
- Using
compute_dice probably should be discouraged in favour of the DiceMetric class, and it should be mentioned that they do the same computation. It's possible this function isn't used by anyone and can be deprecated entirely.
- An example in the docstring of how to use the metric and the loss to get expected results should be included.
Is your feature request related to a problem? Please describe.
The docstring descriptions for
DiceLoss,DiceMetric,DiceHelper, andcompute_diceshould include more information about the expectations of inputs, implications of various arguments, and better examples. There's been some confusion about why results from the loss don't match expectations given the value of metrics, this is related to the extra features in the loss such as the smoothing values as well as misunderstanding about activation or thresholding/one-hot formatting.Describe the solution you'd like
A few things should be changed or added:
DiceMetricshould make it clear the ground truth and prediction can be either single-channel label maps or multi-channel one-hot tensors.softmaxparameter ofDiceHelperis confusing in that it appears to indicatesoftmaxwill be applied if it's true, rather than the expectation that this was already done to the prediction. This should be renamed toargmaxand the old name deprecated. It should also be noted that this parameter becomes the opposite value tosigmoidif not given a value.compute_diceprobably should be discouraged in favour of theDiceMetricclass, and it should be mentioned that they do the same computation. It's possible this function isn't used by anyone and can be deprecated entirely.