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

Avoid sampling -inf from soft Laplace distribution (solves #1186) #1189

Merged
merged 5 commits into from
Oct 13, 2021

Conversation

omarfsosa
Copy link
Contributor

Similar issue to #1184. Fixed by making the underlying uniform distribution sample from (0, 1) (exclusive, exclusive), as opposed to the previous [0, 1) (inclusive, exclusive).

Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for diagnosing and making this quick fix!

dtype = jnp.result_type(float)
finfo = jnp.finfo(dtype)
minval = finfo.tiny
u = random.uniform(key, shape=sample_shape + self.batch_shape, minval=minval)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, thanks for cleaning up the event shape. +1

@fehiepsi fehiepsi merged commit e45b919 into pyro-ppl:master Oct 13, 2021
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

Successfully merging this pull request may close these issues.

2 participants