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?
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.
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?