torchmetrics
                                
                                 torchmetrics copied to clipboard
                                
                                    torchmetrics copied to clipboard
                            
                            
                            
                        Added generalized dice score metric
What does this PR do?
Fixes #1089 . Didn't manage to make it work for multidimensional multilabel scenarios. However, that shouldn't a very common use case.
Before submitting
- [x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
- [x] Did you read the contributor guideline, Pull Request section?
- [x] Did you make sure to update the docs?
- [x] Did you write any new necessary tests?
PR review
Anyone in the community is free to review the PR once the tests have passed. If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃
I beilve that this shall be automatically resolved in cmd by git merge upstream/master
I beilve that this shall be automatically resolved in cmd by
git merge upstream/master
I tried that, but got merge: upstream/master - not something we can merge. Any tips? I searched the error, but I'm a bit of a git rookie, so I'm afraid I'll break stuff instead of fixing it 😅
@jlcsilva shall be resolved now, pls check if I did not make a mistake... :rabbit:
Codecov Report
Merging #1090 (bd375c0) into master (82ab513) will decrease coverage by
35%. The diff coverage is87%.
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1090     +/-   ##
========================================
- Coverage      69%     33%    -35%     
========================================
  Files         307     311      +4     
  Lines       17427   17527    +100     
========================================
- Hits        11989    5849   -6140     
- Misses       5438   11678   +6240     
@jlcsilva shall be resolved now, pls check if I did not make a mistake... 🐰
Seems ok to me.
Also, I know why the tests are failing, but I'm unsure about what to do. In the file tests/unittests/classification/inputs.py I changed the data type of some input tensors, such as _input_binary, from int to float, to match the description here. Since the tests are failing, I'm not sure what's wrong, the documentation or the code. Any thoughts from someone with a better overall view of the repo?
Hi @jlcsilva, when looking at the changes in the PR there also seems to be some changes to other metrics. Any particular reason for this?
@SkafteNicki I believe they are coming from resolving the merge conflicts
Hi @jlcsilva, when looking at the changes in the PR there also seems to be some changes to other metrics. Any particular reason for this?
In the StatScore class I added the None option for the reduce argument, which I needed for my generalized dice score implementation, and changed its documentation and that of its subclasses accordingly. Additionally, I corrected some typos and added some missing information to these classes' documentation.
Finally, I changes the data type of some test inputs to match that in the general input type documentation page, and added new multidimensional input tensors. To me, this seems to be what is making the code fail the tests. Currently, I'm out of office, but I'll check it as soon as I go back to work
Hey @SkafteNicki, No problem! I've also been away, so wasn't able to help. I noticed the changes when I came back and pulled the repo again. I'm actually a bit busy today and next week, but let me know if there is something I can help with :)
@jlcsilva @SkafteNicki, mind checking the collisions after the refactor was merged... :)
@jlcsilva @stancld, mind checking the collisions after the refactor was merged... :otter:
@Borda I'll do rebase now.
ℹ️ It will be needed to add test cases after refactoring tests as a part of the classification refactor. (I can do it on Friday, I guess)
Going to take over this PR now so we hopefully can land it within the next week :]
Going to take over this PR now so we hopefully can land it within the next week :]
hi @SkafteNicki how is it going here? :)
@justusschock, how much need to be done? :chipmunk:
@SkafteNicki could you pls re-check as you had some requested changes... :chipmunk:
For future reference, we should compare against this implementation: https://github.com/Project-MONAI/MONAI/blob/dev/monai/metrics/generalized_dice.py
@jlcsilva, any chance you could work on this one, in particular, add some tests... :flags:
seems we hit some internal Gh issue, will be restarted later...