Skip to content

Commit

Permalink
Update tutorials/docs-10-using-turing-autodiff/index.qmd
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Dalle <[email protected]>
  • Loading branch information
willtebbutt and gdalle authored Nov 8, 2024
1 parent a05a58b commit f6c8a4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tutorials/docs-10-using-turing-autodiff/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ As of Turing version v0.30, the global configuration flag for the AD backend has
Users can pass the `adtype` keyword argument to the sampler constructor to select the desired AD backend, with the default being `AutoForwardDiff(; chunksize=0)`.

For `ForwardDiff`, pass `adtype=AutoForwardDiff(; chunksize)` to the sampler constructor. A `chunksize` of 0 permits the chunk size to be automatically determined. For more information regarding the selection of `chunksize`, please refer to [related section of `ForwardDiff`'s documentation](https://juliadiff.org/ForwardDiff.jl/dev/user/advanced/#Configuring-Chunk-Size).
For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. An additional argument can be provided to `AutoReverseDiff` to specify whether to to cache the tape only once and reuse it later use (`false` by default, which means no caching). This can substantially improve performance, but risks silently incorrect results if not used with care.
For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. An additional keyword argument called `compile` can be provided to `AutoReverseDiff`. It specifies whether to pre-record the tape only once and reuse it later (`compile` is set to `false` by default, which means no pre-recording). This can substantially improve performance, but risks silently incorrect results if not used with care.



Cached tapes should only be used if you are absolutely certain that the sequence of operations performed in your code does not change between different executions of your model.
Expand Down

0 comments on commit f6c8a4d

Please sign in to comment.