Skip to content

Dice loss is smaller when computed on entire batch #99

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

Open
AlessandroGrassi1998 opened this issue Jan 14, 2024 · 1 comment
Open

Dice loss is smaller when computed on entire batch #99

AlessandroGrassi1998 opened this issue Jan 14, 2024 · 1 comment

Comments

@AlessandroGrassi1998
Copy link

🐛 Bug

I noticed that when I compute the dice loss on an entire batch the loss is smaller than computing it singularly for each sample and then averaging it. Is this behavior intended?

Expected behavior

Dice loss on batch equivalent to average of dice losses

Environment

Using loss from segmentation_models_pytorch

@nistring
Copy link

A year passed, though. See this qubvel-org/segmentation_models.pytorch#712 (comment)

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