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

Is there a minimal example of what a new HMC algorithm needs to implement to be able to fit into this framework? #384

Open
nihcompmed opened this issue Dec 23, 2024 · 1 comment

Comments

@nihcompmed
Copy link

This is not so much an issue as a request for advice. I have developed a new HMC algorithm that doesn't use gradients, integrators or compute trajectories but uses a specific Hamiltonian form (that isn't separable). I would like to use AdvancedHMC to compare its performance with all the tried and tested old HMC algorithms. Is there a minimal template for what I need to implement to interface with the rest of AdvancedHMC.jl? Or should I try to interface with more general MC samplers, except that I provide my own function for new proposals? Thanks for any advice.

@alicedb2
Copy link

alicedb2 commented Feb 24, 2025

Funny you ask that, this very morning I was going on a hunt for an answer to the exact same question because of this new derivative-free sampler very similar in spirit to NUTS which came out barely a month ago called the No-Underrun Sampler (NURS). I was wondering if AdvancedHMC.jl was the right place to ask but unsure given that HMC fundamentally relies on computing the derivative.

Going back to your question, the interface is specified by AbstractMCMC.jl and gives a basic example here https://turinglang.org/AbstractMCMC.jl/stable/design/#Basic-structure and at its core you only have to implement the step function.

New samplers are usually implemented as their own package, a good place to start would be the look at the sources of Turing's advanced Metropolis-Hastings sampler (AdvancedMH.jl).

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