You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Documentation and Tutorials for Turing.jl
2
2
3
3
This repository is part of [Turing.jl's](https://turinglang.org/) website (i.e. `https://turinglang.org/docs/`). It contains the Turing.jl documentation and tutorials.
4
-
- The `master` branch contains the quarto source
5
-
- The `gh-pages` branch contains the `html` version of these documents compiled from the `master` branch.
4
+
- The `main` branch contains the quarto source
5
+
- The `gh-pages` branch contains the `html` version of these documents compiled from the `main` branch.
Copy file name to clipboardExpand all lines: _quarto.yml
+2-2
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ website:
116
116
background: "#073c44"
117
117
left: |
118
118
Turing is created by <a href="http://mlg.eng.cam.ac.uk/hong/" target="_blank">Hong Ge</a>, and lovingly maintained by the <a href="https://github.com/TuringLang/Turing.jl/graphs/contributors" target="_blank">core team</a> of volunteers. <br>
The function `sample` is part of the AbstractMCMC interface. As explained in the [interface guide]({{<metausing-turing-interface>}}), building a sampling method that can be used by `sample` consists in overloading the structs and functions in `AbstractMCMC`. The interface guide also gives a standalone example of their implementation, [`AdvancedMH.jl`]().
39
39
40
-
Turing sampling methods (most of which are written [here](https://github.com/TuringLang/Turing.jl/tree/master/src/mcmc)) also implement `AbstractMCMC`. Turing defines a particular architecture for `AbstractMCMC` implementations, that enables working with models defined by the `@model` macro, and uses DynamicPPL as a backend. The goal of this page is to describe this architecture, and how you would go about implementing your own sampling method in Turing, using Importance Sampling as an example. I don't go into all the details: for instance, I don't address selectors or parallelism.
40
+
Turing sampling methods (most of which are written [here](https://github.com/TuringLang/Turing.jl/tree/main/src/mcmc)) also implement `AbstractMCMC`. Turing defines a particular architecture for `AbstractMCMC` implementations, that enables working with models defined by the `@model` macro, and uses DynamicPPL as a backend. The goal of this page is to describe this architecture, and how you would go about implementing your own sampling method in Turing, using Importance Sampling as an example. I don't go into all the details: for instance, I don't address selectors or parallelism.
41
41
42
42
First, we explain how Importance Sampling works in the abstract. Consider the model defined in the first code block. Mathematically, it can be written:
43
43
@@ -86,7 +86,7 @@ mod = gdemo(1.5, 2)
86
86
87
87
creates an instance `mod` of the struct `Model`, which corresponds to the observations of a value of `1.5` for `x`, and a value of `2` for `y`.
88
88
89
-
This is all handled by DynamicPPL, more specifically [here](https://github.com/TuringLang/DynamicPPL.jl/blob/master/src/model.jl). I will return to how models are used to inform sampling algorithms [below](#assumeobserve).
89
+
This is all handled by DynamicPPL, more specifically [here](https://github.com/TuringLang/DynamicPPL.jl/blob/main/src/model.jl). I will return to how models are used to inform sampling algorithms [below](#assumeobserve).
90
90
91
91
### Algorithms
92
92
@@ -217,7 +217,7 @@ A lot of the things here are method-specific. However, Turing also has some func
217
217
- its value: $\theta$
218
218
- log of the joint probability of the observed data and this sample: `lp`
219
219
220
-
`Inference.jl`[defines](https://github.com/TuringLang/Turing.jl/blob/master/src/inference/Inference.jl#L103) a struct `Transition`, which corresponds to this default situation
220
+
`Inference.jl`[defines](https://github.com/TuringLang/Turing.jl/blob/main/src/inference/Inference.jl#L103) a struct `Transition`, which corresponds to this default situation
It also [contains](https://github.com/TuringLang/Turing.jl/blob/master/src/inference/Inference.jl#L108) a constructor that builds an instance of `Transition` from an instance `spl` of `Sampler`: $\theta$ is `spl.state.vi` converted to a `namedtuple`, and `lp` is `getlogp(spl.state.vi)`. `is.jl` uses this default constructor at the end of the `step!` function [here](https://github.com/TuringLang/Turing.jl/blob/master/src/inference/is.jl#L58).
230
+
It also [contains](https://github.com/TuringLang/Turing.jl/blob/main/src/inference/Inference.jl#L108) a constructor that builds an instance of `Transition` from an instance `spl` of `Sampler`: $\theta$ is `spl.state.vi` converted to a `namedtuple`, and `lp` is `getlogp(spl.state.vi)`. `is.jl` uses this default constructor at the end of the `step!` function [here](https://github.com/TuringLang/Turing.jl/blob/main/src/inference/is.jl#L58).
0 commit comments