blackjax icon indicating copy to clipboard operation
blackjax copied to clipboard

Unadjusted HMC, and generalizing the MH code

Open reubenharry opened this issue 4 months ago • 5 comments

Current behavior

The current HMC implementation performs n steps of discretized Hamiltonian dynamics and then an MH accept/reject.

Desired behavior

It would be useful to also have unadjusted HMC (so, the same but without the MH adjustment). This just amounts to running the integrator, so is easy to implement - the question is just whether to have a wrapper around it and present it as a separate algorithm (along with a tuning algorithm in the vein of MCLMC).

Relatedly, if we did that, we could then write standard (i.e. adjusted) HMC as a function of the unadjusted kernel, i.e. in pseudocode:

adjusted_kernel(base_kernel):
    def f(state):
        new_state, info = run_n_steps_of(base_kernel)
        accept = some_function_of(info)
        if accept:
            return new_state
         else: return state 

Note that blackjax does something pretty similar already (see hmc_proposal).

reubenharry avatar Oct 15 '24 17:10 reubenharry