Replies: 2 comments 4 replies
-
Hi, I think I can try to help! I will give examples with explanations for the case of multidimension multi-class:
If you use default parameter
If you use default parameter
If you want to get metrics per each class, you can set
The same still works for multidimension multi-class with logits or probabilities. |
Beta Was this translation helpful? Give feedback.
-
@YerePhy I think in your case you should modify the shape of target vector, so it has one mask with values 0, 1 and 2 (if number of classes is 3). If your Example:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
Context
Im new to torchmetrics and the documentation of these parameters is really not clear for me... I'm working with
Multi-dimensional multi-class with logits or probabilities
e.g. tensors with shapeNCHWD
. I want to compute theDice
metric 'per-class' (should give a tensor with shapeNC
) and the average 'per-sample' (final tensor with shapeC
). Im settingaverage='none'
,mdmc_average='samplewise'
according with the documentation:average
:'none'
orNone
: Calculate the metric for each class separately, and return the metric for every class.mdmc_average
:'samplewise'
: In this case, the statistics are computed separately for each sample on the N axis, and then averaged over samples. The computation for each sample is done by treating the flattened extra axes ... (see Input types) as theN
dimension within the sample, and computing the metric for the sample based on that.However, the documentation of these parameters is not clear, at least for me:
average
: Defines the reduction that is applied.mdmc_average
: Defines how averaging is done for multi-dimensional multi-class inputs (on top of the average parameter).Questions
It seems like the documentation is saying the same for both parameters... how these two parameters interact? Could someone be a little more specific or provide a more detailed explanation?
Beta Was this translation helpful? Give feedback.
All reactions