Section 2 pymc3 error
Closed this issue · 5 comments
Deleted user commented
Section 2 - Model Check II - Bayes Factor
Model fails
14
15 y_like = pm.DensityDist('y_like',
---> 16 lambda value: pm.switch(tau,
17 pm.Poisson.dist(mu_p).logp(value),
18 pm.NegativeBinomial.dist(mu_nb, alpha).logp(value)
AttributeError: module 'pymc3' has no attribute 'switch'
Found a fix suggested by Cameron Davidson-Pilson which looks like it was intended to be merged into your code (but seems it wasn't?). The suggested revision to lambda works fine.
y_like = pm.DensityDist('y_like',
lambda value: pm.math.switch(tau,
pm.Poisson.dist(mu_p).logp(value),
pm.NegativeBinomial.dist(mu_nb, alpha).logp(value)
),
observed=messages['time_delay_seconds'].values)
twiecki commented
Yep, we changed that namespace, easy fix.
twiecki commented
@krispy1946 Maybe do a PR.
Deleted user commented
Some advice please as I'm not a regular 'user' of git.
I've committed my local changes to my cloned repository but when I make a
pull request I get every change made (whether relevant or not). Is it
possible to isolate the one simple code change made or do I send the lot?
Thanks.
Chris
…On 2 February 2017 at 10:08, Thomas Wiecki ***@***.***> wrote:
@krispy1946 <https://github.com/krispy1946> Maybe do a PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AECpBbortCc7_4e2mTokWN6lpUVoMgjNks5rYZz1gaJpZM4L025A>
.
markdregan commented
Thanks for flagging Chris. I'm re-running all notebooks now and fixing issues. Been a while and PYMC3 has come on even further since I last used it. Will push later this weekend.
markdregan commented
Pushed updated notebooks.
pm.math.switch issue fixed.