You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GeneralizedDiceScore reductions do not work as expected #7966
This leads to problems that propagate to GeneralizedDiceScore as below,
generalized_dice_score=GeneralizedDiceScore()
generalized_dice_score(a, b)
Aggregating this over different reductions shows unexpected results and errors.
Case 1: generalized_dice_score.aggregate(reduction="sum") and generalized_dice_score.aggregate(reduction="mean") return this error IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
Case 2: generalized_dice_score.aggregate(reduction="sum_batch") returns a single-element tensor but it should return a tensor with the size as number of classes containing dice scores summed across all batches for each class. Similar for mean_batch.
Case 3: generalized_dice_score.aggregate(reduction="none") should give dice scores across batch and classes unreduced (similar to compute_generalized_dice) but it gives values reduced over all classes.
Environment
Ensuring you use the relevant python executable, please paste the output of:
Activity
Fix generalized dice computation (#7970)