Skip to content

Commit

Permalink
Update external-samplers.jmd
Browse files Browse the repository at this point in the history
  • Loading branch information
yebai authored Oct 20, 2023
1 parent 05db262 commit bfc81db
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,19 @@ There are several characteristics to note in these functions:
- The functions must follow the displayed signatures.
- The output of the functions must be a transition, the current state of the sampler, and a sample, what is saved to the MCMC chain.

The last requirement is that the transition must be structured with a field `θ` which contains the values of the parameters of the model for said transition.
The last requirement is that the transition must be structured with a field `θ`, which contains the values of the parameters of the model for said transition.
This allows `Turing` to seamlessly extract the parameter values at each step of the chain when bundling the chains.
Note that if the external sampler produces transitions that Turing cannot parse the bundling of the samples will be different or fail.
Note that if the external sampler produces transitions that Turing cannot parse, the bundling of the samples will be different or fail.

For practical examples of how to adapt a sampling library to the `AbstractMCMC` interface, the readers can consult the following libraries:

- <a href="https://github.com/TuringLang/AdvancedMH.jl/blob/458a602ac32a8514a117d4c671396a9ba8acbdab/src/mh-core.jl#L73-L115">AdvancedMH</a>
- <a href="https://github.com/TuringLang/AdvancedHMC.jl/blob/762e55f894d142495a41a6eba0eed9201da0a600/src/abstractmcmc.jl#L102-L170">AdvancedHMC</a>
- <a href="https://github.com/JaimeRZP/MicroCanonicalHMC.jl/blob/master/src/abstractmcmc.jl">MicroCanonicalHMC</a>
- [AdvancedMH](https://github.com/TuringLang/AdvancedMH.jl/blob/458a602ac32a8514a117d4c671396a9ba8acbdab/src/mh-core.jl#L73-L115)
- [AdvancedHMC](https://github.com/TuringLang/AdvancedHMC.jl/blob/762e55f894d142495a41a6eba0eed9201da0a600/src/abstractmcmc.jl#L102-L170)
- [MicroCanonicalHMC](https://github.com/JaimeRZP/MicroCanonicalHMC.jl/blob/master/src/abstractmcmc.jl)

# Refences

[^1]: Xu et al, <a href="http://proceedings.mlr.press/v118/xu20a/xu20a.pdf">AdvancedHMC.jl: A robust, modular and efficient implementation of advanced HMC algorithms</a>, 2019
[^2]: Zhang et al, <a href="https://arxiv.org/abs/2108.03782">Pathfinder: Parallel quasi-Newton variational inference</a> , 2021
[^3]: Robnik et al, <a href="https://arxiv.org/abs/2212.08549">Microcanonical Hamiltonian Monte Carlo</a>, 2022
[^4]: Robnik and Seljak, <a href="https://arxiv.org/abs/2303.18221">Langevine Hamiltonian Monte Carlo</a>, 2023
[^1]: Xu et al., [AdvancedHMC.jl: A robust, modular and efficient implementation of advanced HMC algorithms](http://proceedings.mlr.press/v118/xu20a/xu20a.pdf), 2019
[^2]: Zhang et al., [Pathfinder: Parallel quasi-Newton variational inference](https://arxiv.org/abs/2108.03782), 2021
[^3]: Robnik et al, [Microcanonical Hamiltonian Monte Carlo](https://arxiv.org/abs/2212.08549), 2022
[^4]: Robnik and Seljak, [Langevine Hamiltonian Monte Carlo](https://arxiv.org/abs/2303.18221), 2023

0 comments on commit bfc81db

Please sign in to comment.