Skip to content

Commit

Permalink
External samplers docs (#428)
Browse files Browse the repository at this point in the history
* Add all high level docs from Turing.jl

* Fix some permalinks.

* Converted Quickstart doc

* Converted contributing pages to jmd

* add project files

* Disable evaluating style examples

* Update and rename index.md to index.jmd

* Rename index.jmd to using-turing.jmd

* fix formatting for guide.md

* Fixed formatting.

* Update tutorials/for-developers-interface/interface.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tutorials/for-developers-abstractmcmc-turing/how_turing_implements_abstractmcmc.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tutorials/for-developers-abstractmcmc-turing/how_turing_implements_abstractmcmc.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* update sample viz

* add dummy julia code block to enable jmd building

* Bugfix for negative variance.

* More conversions

* Added dependencies and changed directory names

* Fixed dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* Fixing dependencies

* other tutorials

* other tutorials

* other tutorials

* fix merge conflict with master

* some edits to advanced

* remove weave from deps

* improve compiler

* added julia formatting for a block which it was missing (#398)

Co-authored-by: Hong Ge <[email protected]>

* AbstractMCMC fixes, rename some files, and update manifests (#399)

* abstract-mcmc

* Rename files

* no empty cell + hyperlink to bishop (#400)

* add numeric prefix to docs

* triger rebuild

* add Distributions to deps

* minor fixes

* Minor edits

* Update tutorials/docs-12-using-turing-guide/using-turing-guide.jmd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tutorials/docs-09-using-turing-advanced/advanced.jmd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* docs draft

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* upd branch

* env

* format

* better name

* undoing rename

* undoing fck up

* working on Pathfinder example

* Apply suggestions from code review

Co-authored-by: Tor Erlend Fjelde <[email protected]>

* citations

* no propaganda

* flesing out the examples

* format

* more concise

* format

* advancedMH

* for devs

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tutorials/15-external-samplers/external-samplers.jmd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* bug

* Apply suggestions from code review

Co-authored-by: Tor Erlend Fjelde <[email protected]>

* upd

* Update tutorials/15-external-samplers/external-samplers.jmd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tutorials/15-external-samplers/external-samplers.jmd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update external-samplers.jmd

* update manifest.toml

* Update external-samplers.jmd

* update manifest file

* bug

* upd deps

* Revert "upd deps"

This reverts commit 32284d5.

* bump manifesto

* nearly there

* bump turing

* slight formatting error

* folder name conv

* folder name conv

* rm old files

* hyperlinks in html

* Update tutorials/docs-16-using-turing-external-samplers/external-samplers.jmd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update external-samplers.jmd

---------

Co-authored-by: Hong Ge <[email protected]>
Co-authored-by: Colton Botta <[email protected]>
Co-authored-by: Hong Ge <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tor Erlend Fjelde <[email protected]>
Co-authored-by: Will Tebbutt <[email protected]>
  • Loading branch information
7 people authored Oct 20, 2023
1 parent aa511e8 commit 86ab4e5
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:

- (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] within `MicroCanonicalHMC`.
- [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, (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
[^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 86ab4e5

Please sign in to comment.