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

expit of logistic variable gives log_prob 0.0 #65

Open
knutdrand opened this issue Feb 27, 2024 · 0 comments
Open

expit of logistic variable gives log_prob 0.0 #65

knutdrand opened this issue Feb 27, 2024 · 0 comments

Comments

@knutdrand
Copy link

I'm trying to get the logprob of a expit-transformed logistic-distributed variable but it always returns zero:

import jax.random
from oryx.core.ppl import random_variable, log_prob
from jax.scipy.special import expit
import oryx.distributions as tfd


def simple_sample(key):
    a = random_variable(tfd.Logistic(0., 1.))(key)
    return expit(a)


x = simple_sample(jax.random.PRNGKey(0))
print(x)  # 0.41845703
print(log_prob(simple_sample)(0.5))  # 0.0
print(log_prob(simple_sample)(x))  # 0.0

Versions:
jax-0.4.25
oryx-0.2.6

(Both a exp transformed logistic variable and a expit transformed normal variable seems to work, so there is something special about this combination)

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