Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazomej committed Jan 15, 2025
1 parent 497ea2a commit a1c2ad8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ we use the `:advi` keyword argument in the `BarBay.vi.advi` function. For
`ForwardDiff`, we use

```julia
:advi => Turing.ADVI(n_samples, n_steps)
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoForwardDiff())
```

as `ForwardDiff` is the default backend. For `ReverseDiff`, we use

```julia
:advi => Turing.ADVI{AdvancedVI.ReverseDiffAD{false}}(n_samples, n_steps)
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoReverseDiff(false))
```

where the `false` indicates that we are not using the cache for the random
Expand Down Expand Up @@ -155,7 +155,7 @@ param = Dict(
:s_bc_prior => [0.0, 1.0],
:logλ_prior => logλ_prior,
),
:advi => Turing.ADVI(n_samples, n_steps),
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoForwardDiff()),
:opt => Turing.TruncatedADAGrad()
)

Expand Down Expand Up @@ -348,7 +348,7 @@ param = Dict(
:logλ_prior => logλ_prior,
),
:env_col => :env,
:advi => Turing.ADVI(n_samples, n_steps),
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoForwardDiff()),
:opt => Turing.TruncatedADAGrad()
)

Expand Down Expand Up @@ -452,7 +452,7 @@ param = Dict(
:logλ_prior => logλ_prior,
:logτ_prior => [-2.0, 0.5],
),
:advi => Turing.ADVI(n_samples, n_steps),
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoForwardDiff()),
:opt => Turing.TruncatedADAGrad(),
:rep_col => :rep,
:fullrank => false
Expand Down Expand Up @@ -558,7 +558,7 @@ param = Dict(
:logλ_prior => logλ_prior,
),
:genotype_col => :genotype,
:advi => Turing.ADVI(n_samples, n_steps),
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoForwardDiff()),
:opt => Turing.TruncatedADAGrad()
)

Expand Down
13 changes: 7 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ of barcodes is large. However, for small datasets, we recommend using
!!! note
The AutoDiff backend for ADVI is set using the `AdvancedVI` module. This is
done in the `:advi` option of the `param` dictionary. For `ForwardDiff.jl`,
we can do `:advi => Turing.ADVI(n_samples, n_steps)`, as `ForwardDiff.jl` is
the default backend. For `ReverseDiff.jl`, we need to do
`:advi => Turing.ADVI{AdvancedVI.ReverseDiffAD{false}}(n_samples, n_steps)`,
where the `false` indicates that we won't use the cache for the random
number tape. See the
we can do `:advi => Turing.ADVI(n_samples, n_steps,
Turing.AutoForwardDiff())`, as `ForwardDiff.jl` is the default backend. For
`ReverseDiff.jl`, we need to do `:advi =>
Turing.ADVI(n_samples, n_steps, Turing.AutoReverseDiff(false))`, where the
`false` indicates that we won't use the cache for the random number tape.
See the
[`AdvancedVI.jl`](https://github.com/TuringLang/AdvancedVI.jl/tree/master)
repository for more information.

Expand Down Expand Up @@ -324,7 +325,7 @@ param = Dict(
:s_bc_prior => [0.0, 1.0],
:logλ_prior => logλ_prior,
),
:advi => Turing.ADVI{AdvancedVI.ReverseDiffAD{false}}(n_samples, n_steps),
:advi => Turing.ADVI(n_samples, n_steps, Turing.AutoReverseDiff(false)),
:opt => Turing.TruncatedADAGrad(),
)
```
Expand Down

0 comments on commit a1c2ad8

Please sign in to comment.