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

FOGD can Return NaN #1

Open
BillyBarbaro opened this issue Nov 30, 2017 · 0 comments
Open

FOGD can Return NaN #1

BillyBarbaro opened this issue Nov 30, 2017 · 0 comments

Comments

@BillyBarbaro
Copy link

I was experimenting with your implementation of FOGD in this framework, and it turns out it can provide some misleading results. On this line of your approximation for sin(ux) you take a square root of 1 - cos(ux)^2. Normally this computation would be safe since the range of cos^2 is (0, 1); however, because of floating point precision, the value sometimes falls slightly outside this range, the algorithm tries to take the square root of a negative number, and returns NaN.

Looking at the implementation of your Loss Function, it appears whenever this happens, it will cause the instance to be classified as negative. This leads to improved performance on datasets with a majority of negative labels and decreased performance on majority positive label datasets. It can be seen most easily by increasing the value of gamma in your a9a example from 0.001 -> 0.01.

My approach to fixing this was clamping the value of p1 between 0 and 1 after it was calculated here.

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