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

Nan values in focal loss #16

Open
maferoaloaiza opened this issue Nov 27, 2020 · 1 comment
Open

Nan values in focal loss #16

maferoaloaiza opened this issue Nov 27, 2020 · 1 comment

Comments

@maferoaloaiza
Copy link

Hi, I am using your implementation of focal loss, and sometimes the value calculated is nan. I realized that it is due to the normalization in terms of positive samples in the batch since I am working with 3D data, and I can't have big batches. I have a very unbalanced dataset as well. That causes that some of my batches are composed of only negative samples, so the normalization ends up having a zero division. How would you recommend I perform the normalization in this case?

@RaagaMadappa
Copy link

Hi
Did you find a solution for this? I am getting nan values too because my dataset is highly unbalanced and for all the batches there is atleast one 0 value in the samples per class list.

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