CamDavidsonPilon / Probabilistic-Programming-and-Bayesian-Methods-for-Hackers

aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
MIT License
26.67k stars 7.86k forks source link

AttributeError: 'pymc3' object has no attribute 'switch' #319

Closed vladserkoff closed 7 years ago

vladserkoff commented 7 years ago

Hey, thanks for the transition to pymc3! There's probably a typo in the 8th cell in Intro Chapter Should lambda_ = pm.switch(tau >= idx, lambda_1, lambda_2) be lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2) instead?

twiecki commented 7 years ago

Thanks! CC @mmargenot

mmargenot commented 7 years ago

Yeah, that looks like it is due to a more recent change in the package.

Both lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2)

and import theano.tensor as tt lambda_ = tt.switch(tau >= idx, lambda_1, lambda_2)

should work.

twiecki commented 7 years ago

Closed by #321 .

vladserkoff commented 7 years ago

Thanks!