Skip to content
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

DEMetropolis chains share tuned hyperparameter (with cores=1) #3731

Closed
michaelosthege opened this issue Dec 15, 2019 · 0 comments · Fixed by #3732
Closed

DEMetropolis chains share tuned hyperparameter (with cores=1) #3731

michaelosthege opened this issue Dec 15, 2019 · 0 comments · Fixed by #3732
Labels

Comments

@michaelosthege
Copy link
Member

michaelosthege commented Dec 15, 2019

Observations

When DEMetropolis is used with cores > 1 and chains > 1, all chains are independently tuned.

With cores=1 however, chains share the tuned scaling parameter and when it's updated during tuning, the adjustments by all chains are superimposed.

Cause

For DEMetropolis, the steppers are shallow-copied. This shallow-copy somehow keeps their tuned hyperparameter shared.

https://github.com/pymc-devs/pymc3/blob/dc9fd7251b34e9851308e91d622513ebe648f49e/pymc3/sampling.py#L933-L939

michaelosthege added a commit to michaelosthege/pymc that referenced this issue Dec 15, 2019
michaelosthege added a commit to michaelosthege/pymc that referenced this issue Dec 15, 2019
@michaelosthege michaelosthege changed the title Not all chains are created equal (with cores=1) DEMetropolis chains share tuned hyperparameter (with cores=1) Dec 15, 2019
junpenglao pushed a commit that referenced this issue Dec 16, 2019
* add regression test to demo #3731

* return new array and don't touch original in tune method
+ see #3731

* add 'accepted' and 'scaling'  to (DE)Metropolis sampler stats

* use existing model.ndim property for code clarity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant