-
Notifications
You must be signed in to change notification settings - Fork 1
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
KL for discrete distributions #91
Comments
Are there more? |
You can get |
It might be a good idea to build a KL table to see which pairs we are
missing, I tried to do it today, but couldn't do it in github. Maybe design
doc ?
…On Mon, Jan 29, 2018, 10:58 PM Vishwak Srinivasan ***@***.***> wrote:
I will take this up for the time being. @fritzo
<https://github.com/fritzo> @alicanb <https://github.com/alicanb>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#91 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCw1tNhrdgcr_a2VRX94k22GZgMD6W0ks5tPpNmgaJpZM4RevaV>
.
|
@alicanb Yeah, having a table would be a great idea. I don't know if it should be added in the Design doc. I think it will be better to have it in Markdown too. |
I think I will look at this later. Sorry @alicanb |
@vishwakftw Do you think it's easy to compute |
At a glance, I think there might be issues with the finite sum of the exponential term in the Poisson's pmf. Furthermore, the I will have a detailed look at it and revert to you tomorrow if that is fine. |
We can always calculate this numerically since binomial has |
The summation should actually not be hard to implement in PyTorch. Something like this should do the trick: def this_sum(n, p):
factor = n.lgamma.exp()
valrange = torch.arange(0, n + 1).lgamma()
return factor * (reverse(valrange) / (valrange + reverse(valrange)).exp()) * p.pow(valrange) * (1 - p).pow(reverse(valrange))).sum(-1) |
@vishwakftw I like the idea of implementing the exact sum. It should be cheap on GPUs, and I've seldom seen binomial used with large |
@fritzo Sure, we could do that. I will send in a PR soon. |
Give me a few hours, I already have something that tackles Binom-Binom, Binom-Geo, and Binom-Poi KLs |
Amazing!! Thanks @alicanb . |
@vishwakftw That's so cool, is there a way we can put that in docs? |
It should be possible, but the issue is that the table is too big. |
No description provided.
The text was updated successfully, but these errors were encountered: