Skip to content

Fix rvs shape parameter for distribution#9

Merged
fehiepsi merged 3 commits intomasterfrom
fix-rvs-shape
Feb 27, 2019
Merged

Fix rvs shape parameter for distribution#9
fehiepsi merged 3 commits intomasterfrom
fix-rvs-shape

Conversation

@neerajprad
Copy link
Member

@neerajprad neerajprad commented Feb 27, 2019

@fehiepsi - Sorry if I merged #7 too soon. 😄 I have added an xfail for the last test, feel free to push to this branch directly to resolve it.

# assert that rng is PRNGKey and not mtrand.RandomState object from numpy.
assert not isinstance(rng, mtrand.RandomState)
args = deque(args)
loc = kwargs.get('loc', args.popleft() if len(args) > 0 else 0)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to have the same behavior as logpdf. In addition the third arg can be size as is the case with scipy.stats.



@pytest.mark.parametrize("alpha", [1e-4, 1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3, 1e4])
@pytest.mark.xfail(reason="TypeError: __invert__() missing 1 required")
Copy link
Member

Choose a reason for hiding this comment

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

Opps... I guess this is due to JAX version? The test passed in my system (CPU).

Copy link
Member Author

Choose a reason for hiding this comment

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

What's the version of JAX you are using?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh..you are right, just updating jax now.

@fehiepsi
Copy link
Member

@neerajprad The inverse error is due to a typo, which is fixed at jax-ml/jax#388. I don't know which operator called it so we might enable the test later when a new version of jax is released.

@fehiepsi fehiepsi merged commit dddfe1f into master Feb 27, 2019
@neerajprad neerajprad deleted the fix-rvs-shape branch November 19, 2019 19:03
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