-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sample's step_kwargs argument doesn't recognize 'metropolis' #3197
Comments
@moeyensj thank you for the bug report! After a bit of digging around, it looks like the issue stems from this block of code. Essentially, the problem is that I'll try and put together a patch sometime this week, but in the meantime, I can only suggest that you use the |
@moeyensj I just whipped up a PR to fix your issue; if all goes well it'll be merged soon 😄 |
@eigenfoo Thanks so much! I can fork the repo and test your PR if it helps at all. |
The issue wasn't as easy a fix as I was expected: some tests aren't passing, and they look like real failures. I should be able to find time in the next week or so to patch it up, but if you're anxious/brave, feel free to fork my repo and finish it off! 😄 |
The same thing happens with the NUTS: with pm.Model():
b_m = pm.Uniform("b", lower=0, upper=1)
m_m = pm.Uniform("m", lower=0, upper=1)
y_m = pm.Normal("y", mu=m_m*x + b_m , observed=Y)
step = pm.NUTS()
trace = pm.sample(draws=500, step=step, chains=2, nuts_kwargs={"target_accept":0.95}) This is the error output:
Python 2.7.15 |
Also, consider using multiple samplers, for example: with pm.Model():
b_m = pm.Uniform("b", lower=0, upper=1)
m_m = pm.Uniform("m", lower=0, upper=1)
y_m = pm.Normal("y", mu=m_m*x + b_m , observed=Y)
step_A = pm.Metropolis(vars=[b_m])
step_B = pm.NUTS()
trace = pm.sample(draws=500, step=[step_A, step_B], chains=2, step_kwargs={"metropolis": {"scaling": 100}}) This will throw the following error:
Without using |
Hello pymc3-devs and company,
Thank you for your time and effort.
I was trying to set the scaling for the Metropolis-Hastings sampler using the step_kwargs argument but it doesn't recognize the lower case name. It could also very well be that I am misunderstanding the docstring:
Here is a simplified example showing the problem:
This problem can be bypassed if I just instantiated the step method as follows
step = pm.Metropolis(scaling=100)
but I am trying to allow the users of the code I am working on to chose what step method they want to use and its kwargs.Versions and main components
The text was updated successfully, but these errors were encountered: