[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it a small bug in batch_dice?????? #89

Closed
CodingHHW opened this issue Nov 29, 2019 · 1 comment
Closed

is it a small bug in batch_dice?????? #89

CodingHHW opened this issue Nov 29, 2019 · 1 comment

Comments

@CodingHHW
Copy link

in the medicaldetectiontoolkit/utils/model_utils.py, lines 883, batch_dice loss function,
I think should add
if y[:, 1:, ...].max() == 0:
y = 1 - y
pred = 1 - pred

for the patch maybe it has no roi

@Gregor1337
Copy link
Collaborator

Hi CodingHHW,
thanks for your concern.
Since the dice loss is implemented over the whole batch, it is unlikely a class will not at all be present, however it is possible.
For that case, I have added an additive smooth which handles this special case and is negligible in other cases (this commit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants