-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
initial working draft of kameleon mcmc #599
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
Conversation
|
||
|
||
# To avoid Theano complaining about missing test values | ||
TheanoConfigParser().compute_test_value = 'off' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether you allow this, but compiling my expressions fails otherwise.
Very exciting, thanks for putting this up. I'll try to take a look soon but probably won't be able to in the next week or two (vacation after defending ;) ). Regarding the non-symmetric proposals, #547 has an implementation of MH that might help here. |
Thanks! I am more than happy to use the MH step in #547 if it is exposed in a way that I can inherit from the class. If not, the current design is super simple: I just store the log-likelihood and the proposal representation of an accepted step. This patch is not meant to be merged yet, more for figuring out how to embed it within pymc. I need to add a few things on using the chain history. But that's a second step. First I am interested how to organise the code, you will see there is lots of extra stuff that has to be put somewhere. |
travis fails for an unrelated reason I think |
I thought you only need a custom proposal dist? https://github.com/pymc-devs/pymc/pull/547/files#diff-3c696bd218b69d877a316c792c5efa70R31 seems to suggest it's pretty general or why wouldn't that work? |
The main use-case of this sampler is when no gradient is available. For example: pseudo-marginal mcmc (aka noisy target density evaluation). In this case, HMC (which is better than the kernel-MH) is not an option, but only a purely random walk. So to use this thing, one will usually define a custom density which does the pseudo-marginal stuff. The implementation I did also takes care of the accept/reject in a correct way. If one wants to do a std random walk as pseudo-marginal, you need to change your metropolis step method as it re-computes the target density in every step (this is a bad idea in general as it might be expensive) -- one should store the likelihood of the last accepted state. |
self.gamma2 = gamma2 | ||
self.nu2 = nu2 | ||
self.tune = tune | ||
self.tune_stop = tune_stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample
already has a tune
argument to take care of this.
Thanks for the comments @fonnesbeck |
This looks really good. Thanks for the contribution! Though the paper does not seem to say so explicitly, I assume this method is only applicable to continuous random variables? |
Feel free to add an example model to the |
|
We have a set of unit tests in As for the Gaussian sampling, I started a branch to implement random sampling across all distributions, but have not worked on it in awhile. This is ideally where we would like it, as we will have more general usage for random sampling than just this particular step method. |
@karlnapf Any plans to continue here or should we close this? |
No, planning to continue. |
@karlnapf Good to hear! Good luck with ICML. |
@karlnapf Hey Karl! I hope ICML went well! Any news with this? It would be cool to see it production. |
Thanks for the reminder! :) |
Lovely! I look forward to it On Mon, Jun 8, 2015 at 3:17 AM, Heiko Strathmann [email protected]
|
Looking forward to this too. |
Any update on this @karlnapf? I think it'd be a great merge. Maybe we can split this up to a few commits... |
I re-wrote large part of the internals for a recent NIPS paper and another working paper. I will try to put the things in here when I am back next week as I actually got some time at my hand now after the ICML deadline is over. |
Closing for now, feel free to reopen if you make progress. |
Hi
as discussed a while ago, I wrote a draft for the kernel adaptive metropolis hastings sampler from
http://jmlr.org/proceedings/papers/v32/sejdinovic14.html
based on our codes from
https://github.com/karlnapf/kameleon-mcmc
This implementation is based on oracle samples. The actual implementation needs to use the chain history. I did not implement this yet in order to discuss general points with you first, but soon to follow.
There are several things that are not as clean as they could
Finally, no unit tests yet. If this stuff is supposed to go on and we finalised the structure, I am happy to extensively unit test everything, for now I can put an example?
Let me know any comments and I'll update the code.