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

Division by zero when class rebalancing ? #69

Closed
nasdenkov opened this issue Jun 19, 2019 · 2 comments
Closed

Division by zero when class rebalancing ? #69

nasdenkov opened this issue Jun 19, 2019 · 2 comments

Comments

@nasdenkov
Copy link

nasdenkov commented Jun 19, 2019

Hey there !
I've generated my own priors for training based on my own dataset. The problem is that they contain zeros and when I put the exponent -1, like this self.prior_factor = self.mix ** -self.alpha, it generates Infinity values inside my vector because I'm essentially trying to divide by zero Any idea how to fix it would be much appreciated. Thanks !

@richzhang
Copy link
Owner

Maybe you can add an epsilon to it. There's also the focal loss paper which may be of interest.

@nasdenkov
Copy link
Author

nasdenkov commented Jun 19, 2019

I found out that the images in my training set were not contributing enough to all of the identified pairs in the quantized ab space. Technically 87 of the 313 value pairs were unused. Therefore I just used the remaining 226 pairs inside the convex hull as my own hull for training and the priors for those 226 pairs and the problem was resolved. Not sure if it is the correct way to approach this. However, as far as I'm understanding your work so far, if I were to add an epsilon to the mixed distribution, the exponential will end up calculating a huge prior factor for a pixel encoding that actually didn't contribute at all. This will render incorrect prioritizations when backpropagating over the network, I would assume. if you disagree, I'd love to hear your opinion on the matter. You've done a fantastic job with this paper by the way, good work !

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