-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Register the overloads added by CustomDist in worker processes #7241
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
Changes from 5 commits
9757434
54ca772
54f72e2
f96152d
f539b9f
d6cfb89
5b460e4
997d730
b625511
c572542
0e4c01c
bb3e16f
d2669f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,18 @@ def test_unobserved_categorical(self): | |
|
||
assert np.all(np.median(trace["mu"], axis=0) == [1, 2]) | ||
|
||
def test_parallel_custom(self): | ||
def _logp(value, mu): | ||
return -((value - mu) ** 2) | ||
|
||
def _random(mu, rng=None, size=None): | ||
return rng.normal(loc=mu, scale=1, size=size) | ||
|
||
with pm.Model(): | ||
mu = pm.CustomDist("mu", 0, logp=_logp, random=_random) | ||
|
||
pm.CustomDist("y", mu, logp=_logp, class_name="", random=_random, observed=[1, 2]) | ||
pm.sample_smc(draws=6, cores=2) | ||
|
||
def test_marginal_likelihood(self): | ||
""" | ||
Verifies that the log marginal likelihood function | ||
|
Uh oh!
There was an error while loading. Please reload this page.