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

Porting Sine Bivaraite von Mises from Pyro #1063

Merged
merged 27 commits into from
Aug 20, 2021

Conversation

OlaRonning
Copy link
Member

Translating Sine Bivariate von Mises Distribution from Pyro; phi marginal is sampled similarly to von Mises distribution to accommodate for immutable arrays.

@OlaRonning OlaRonning added the WIP label Jun 10, 2021
@OlaRonning OlaRonning added the enhancement New feature or request label Jun 11, 2021
@OlaRonning OlaRonning mentioned this pull request Jul 3, 2021
6 tasks
@OlaRonning OlaRonning removed the WIP label Jul 8, 2021
@OlaRonning OlaRonning requested a review from fehiepsi July 8, 2021 12:16
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.

Thanks, @OlaRonning! I haven't checked the math because this is your port from Pyro. I just have some comments on shape sematics.

numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
docs/source/distributions.rst Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
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.

Hi @OlaRonning, I missed several points in the first pass. Here are some of the new ones. :)

numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
numpyro/distributions/directional.py Outdated Show resolved Hide resolved
@OlaRonning
Copy link
Member Author

OlaRonning commented Jul 10, 2021

Thanks for the review @fehiepsi.


arg_constraints = {
"phi_loc": constraints.circular,
"psi_loc": constraints.circular,
Copy link
Member

Choose a reason for hiding this comment

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

I feel that we can relax this constraint - even with real constraints, we still have valid distributions. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I like the circular constraint because it is explicit; what is the advantage of using real constraint?

Copy link
Member

Choose a reason for hiding this comment

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

It is just unnecessary imo (e.g. we can allow users to put in angles from pi to 2pi or even 10pi). But it is up to you.

@fehiepsi fehiepsi merged commit c9eb769 into pyro-ppl:master Aug 20, 2021
@OlaRonning OlaRonning deleted the feature/bvm_dist branch August 21, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants