Skip to content

Commit 2bd6e58

Browse files
authored
Fix some typos and broken links (#464)
1 parent 782f2e4 commit 2bd6e58

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

tutorials/docs-00-getting-started/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function sample_posterior(alpha, beta, mean, lambda, iterations)
9595
for i in 1:iterations
9696
sample_variance = rand(InverseGamma(alpha, beta), 1)
9797
sample_x = rand(Normal(mean, sqrt(sample_variance[1]) / lambda), 1)
98-
sanples = append!(samples, sample_x)
98+
samples = append!(samples, sample_x)
9999
end
100100
return samples
101101
end

tutorials/docs-01-contributing-guide/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Contributing
44

55
Turing is an open-source project. If you feel that you have relevant skills and are interested in contributing, please get in touch. You can contribute by opening issues on GitHub, implementing things yourself, and making a pull request. We would also appreciate example models written using Turing.
66

7-
Turing has a [style guide]({{< meta site-url >}}docs/tutorials/docs-02-contributing-style-guide/). Reviewing it before making a pull request is not strictly necessary, but you may be asked to change portions of your code to conform with the style guide before it is merged.
7+
Turing has a [style guide](#style-guide). Reviewing it before making a pull request is not strictly necessary, but you may be asked to change portions of your code to conform with the style guide before it is merged.
88

99
### What Can I Do?
1010

tutorials/docs-04-for-developers-abstractmcmc-turing/index.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ n_samples = 1000
3333
chn = sample(mod, alg, n_samples, progress=false)
3434
```
3535

36-
The function `sample` is part of the AbstractMCMC interface. As explained in the [interface guide](https://turinglang.org/dev/docs/for-developers/interface), building a 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`]().
36+
The function `sample` is part of the AbstractMCMC interface. As explained in the [interface guide](https://turinglang.org/dev/docs/for-developers/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`]().
3737

38-
Turing sampling methods (most of which are written [here](https://github.com/TuringLang/Turing.jl/tree/master/src/inference)) 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.
38+
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.
3939

4040
First, we explain how Importance Sampling works in the abstract. Consider the model defined in the first code block. Mathematically, it can be written:
4141

tutorials/docs-12-using-turing-guide/index.qmd

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,17 @@ For example, let `c` be a `Chain`:
340340

341341
#### Variable Types and Type Parameters
342342

343-
The element type of a vector (or matrix) of random variables should match the `eltype` of the its prior distribution, `<: Integer` for discrete distributions and `<: AbstractFloat` for continuous distributions. Moreover, if the continuous random variable is to be sampled using a Hamiltonian sampler, the vector's element type needs to either be:
343+
The element type of a vector (or matrix) of random variables should match the `eltype` of its prior distribution, `<: Integer` for discrete distributions and `<: AbstractFloat` for continuous distributions. Moreover, if the continuous random variable is to be sampled using a Hamiltonian sampler, the vector's element type needs to either be:
344344

345345
1. `Real` to enable auto-differentiation through the model which uses special number types that are sub-types of `Real`, or
346346

347-
2. Some type parameter `T` defined in the model header using the type parameter syntax, e.g. `function gdemo(x, ::Type{T} = Float64) where {T}`. Similarly, when using a particle sampler, the Julia variable used should either be:
347+
2. Some type parameter `T` defined in the model header using the type parameter syntax, e.g. `function gdemo(x, ::Type{T} = Float64) where {T}`.
348348

349-
3. An `Array`, or
349+
Similarly, when using a particle sampler, the Julia variable used should either be:
350350

351-
4. An instance of some type parameter `T` defined in the model header using the type parameter syntax, e.g. `function gdemo(x, ::Type{T} = Vector{Float64}) where {T}`.
351+
1. An `Array`, or
352+
353+
2. An instance of some type parameter `T` defined in the model header using the type parameter syntax, e.g. `function gdemo(x, ::Type{T} = Vector{Float64}) where {T}`.
352354

353355
### Querying Probabilities from Model or Chain
354356

0 commit comments

Comments
 (0)