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

Fix edge case of Categorical due to simplex numerical issues #1419

Merged
merged 3 commits into from
Jun 13, 2022

Conversation

fehiepsi
Copy link
Member

@fehiepsi fehiepsi commented Jun 3, 2022

Fixes #1402

Copy link
Member

@ordabayevy ordabayevy left a comment

Choose a reason for hiding this comment

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

LGTM! Can you see if pyro-ppl/funsor#594 is also fixed?

FUNSOR_BACKEND=jax pytest test_distribution.py -k test_categorical_event_dim_conversion

@fehiepsi
Copy link
Member Author

fehiepsi commented Jun 8, 2022

Thanks for taking a look, Yerdos. There are many tests are failing after this change. I'm not sure why, will take a closer look later this week.

@fehiepsi fehiepsi added invalid This doesn't seem right and removed awaiting review labels Jun 8, 2022
@fehiepsi fehiepsi removed the invalid This doesn't seem right label Jun 12, 2022
@fehiepsi fehiepsi requested a review from ordabayevy June 12, 2022 15:36
@fehiepsi
Copy link
Member Author

@ordabayevy It seems that funsor test passes after this.

Copy link
Member

@ordabayevy ordabayevy left a comment

Choose a reason for hiding this comment

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

Looks good to me. Did you figure out what was wrong with the normalization in _to_logits_multinom?

@fehiepsi fehiepsi merged commit 1b72dc2 into pyro-ppl:master Jun 13, 2022
@fehiepsi
Copy link
Member Author

The formula that I used is wrong. We should do log(probs/probs.sum(-1, True))

@fehiepsi
Copy link
Member Author

Thanks for reviewing, Yerdos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants