-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
IndexError in GLM using NUTS #2076
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
Comments
I found this error as well and I solved it wrapping a variable I added with Deterministic. Not sure about why. (I don't know about GLM) |
Sounds like #2046 could be related. Does it also happen if you initialize Metropolis with mu from advi? Maybe it matters if the start value contains (un)transformed keys. |
@fonnesbeck Seems like that's code from your recent PR, no? |
Fixed in the above PR. |
@fonnesbeck Nope, still here: with model:
b = pm.Normal('beta_raw', mu=0, sd=1, shape=n_counties)
b = pm.Deterministic('beta', b * 2)
trace = pm.sample(2000, tune=1000) ...
/home/adr/git/pymc3/pymc3/sampling.py in <listcomp>(.0)
467 for tname in b:
468 if tname.startswith(name) and tname!=name:
--> 469 transform_func = [d.transformation for d in model.deterministics if d.name==name]
470 if transform_func:
471 b[tname] = transform_func[0].forward(a[name]).eval()
AttributeError: 'TensorVariable' object has no attribute 'transformation' |
I can add a fix later -- line 519 and 998 of I think it is ok if we leave some edge cases uncovered: right now we use
maybe adding one more underscore to the end, then have a function |
Sounds reasonable to me. |
This seems to also relate to #2109, as |
fixed in #2328 |
Running a GLM that worked in previous versions of PyMC3 now fails when NUTS sampling begins.
ADVI tuning runs fine, but once sampling begins, an
IndexError
is raised.The model also runs fine with alternative samplers (e.g. Metropolis).
Running current master on macOS and Anaconda Python 3.6.
The text was updated successfully, but these errors were encountered: