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
If self.batch is True, the shape of intersection, denominator and w are [C]. In the code, both the intersection and denominator are multiplied by w. If smooth item is ignored, then w doesn't work.
I see, that's a good point, looks like an issue introduced when fixing this bug #5466, please let me know if you are interested in submitting a patch, otherwise I'll have a look soon.
Activity
wyli commentedon Jul 25, 2023
thanks for reporting, I think those are class-wise weighting, the shape [C] makes sense, or do I misunderstand the idea here?
lixinxin9703 commentedon Jul 25, 2023
yes, the shape [c] makes sense. But I think w doesn't work, bacause both the intersection and denominator are multiplied by w.
For example:
intersection: [1,2,3,4];
denominator: [2,3,4,5];
w: [0.1, 0.2, 0.3, 0.4];
so numer / denom = 2*([1, 2, 3, 4] * [0.1, 0.2, 0.3, 0.4)]) / ([2, 3, 4, 5] * [0.1, 0.2, 0.3, 0.4))
then [0.1, 0.2, 0.3, 0.4] are eliminated.
numer / denom = 2*([1, 2, 3, 4]) / ([2, 3, 4, 5])
w doesn't work. I think w is meaningless.
wyli commentedon Jul 25, 2023
I see, that's a good point, looks like an issue introduced when fixing this bug #5466, please let me know if you are interested in submitting a patch, otherwise I'll have a look soon.
lixinxin9703 commentedon Jul 25, 2023
The previous version of the code in #5466 seemed more reasonable
In my opinion, GDL cannot generate [C] output, as GDL will calculate all classes as one metric.
6765 update `GeneralizedDiceLoss` (#6775)