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

Implementation of replica exchange MCMC #861

Closed
YoshikawaMasashi opened this issue Mar 7, 2018 · 4 comments
Closed

Implementation of replica exchange MCMC #861

YoshikawaMasashi opened this issue Mar 7, 2018 · 4 comments

Comments

@YoshikawaMasashi
Copy link
Contributor

Hi all,

I am implementing replica exchange MCMC(Parallel tempering)(https://en.wikipedia.org/wiki/Parallel_tempering).

Replica exchange MCMC is known as a sampling method that is not much affected by local minimums. In this method, multiple sampling is performed with different temperatures in parallel, and frequently exchanged. In high temperature, Markov Chain jump from a local minimum to another local minimum. And, by exchanging, sampling that does not stay in one local minimum is possible.

For example, I sample from mixture gaussian distribution.

cat = Categorical(probs=[0.5,0.5])
x = Mixture(cat=cat, components=
            [MultivariateNormalDiag([0.0,0.0], [1.0,1.0]),
             MultivariateNormalDiag([10.0,10.0], [1.0,1.0])])
proposal_x = MultivariateNormalDiag(x, [1.0,1.0])
qx = Empirical(tf.Variable(tf.zeros([10000, 2])))

In MetropolisHastings, sampling is looks like this.

inference = ed.MetropolisHastings(latent_vars={x: qx},
                                 proposal_vars={x: proposal_x})

image

In HMC, sampling is looks like this.

inference = ed.HMC(latent_vars={x: qx})

image

In SGHMC, sampling is looks like this.

inference = ed.SGHMC(latent_vars={x: qx})

image

And, in replica exchange MCMC, sampling is looks like this.

inference = ed.ReplicaExchangeMC(latent_vars={x: qx},
                                 proposal_vars={x: proposal_x})

image

Thanks.

@dustinvtran
Copy link
Member

Cool! Is the implementation available somewhere? We would love a contribution to merge it in.

@YoshikawaMasashi
Copy link
Contributor Author

YoshikawaMasashi commented Mar 7, 2018

Thanks!

The implementation is this.
6f3175a

And forked repository is this.
https://github.com/YoshikawaMasashi/edward

I would appreciate it if you would give me some advice.

@dustinvtran
Copy link
Member

dustinvtran commented Mar 7, 2018

Cool! Maybe send a PR (https://help.github.com/articles/about-pull-requests/)? Happy to review it and provide in-line comments.

@YoshikawaMasashi
Copy link
Contributor Author

Thank you for your kindness. I close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants