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

Dice loss is smaller when computed on entire batch #99

Open
AlessandroGrassi1998 opened this issue Jan 14, 2024 · 0 comments
Open

Dice loss is smaller when computed on entire batch #99

AlessandroGrassi1998 opened this issue Jan 14, 2024 · 0 comments

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

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

1 participant