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: Tor Erlend Fjelde <[email protected]>
  • Loading branch information
willtebbutt and torfjelde authored Nov 8, 2024
1 parent 5e03a1e commit 85c9ca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tutorials/docs-10-using-turing-autodiff/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For `ReverseDiff`, pass `adtype=AutoReverseDiff()` to the sampler constructor. A
Pre-recorded 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.

Thus, e.g., in the model definition and all implicitly and explicitly called functions in the model, all loops should be of fixed size, and `if`-statements should consistently execute the same branches.
For instance, `if`-statements with conditions that can be determined at compile time or conditions that depend only on fixed properties of the data will always execute the same branches during sampling (if the data is constant throughout sampling and, e.g., no mini-batching is used).
For instance, `if`-statements with conditions that can be determined at compile time or conditions that depend only on fixed properties of the model, e.g. fixed data.
However, `if`-statements that depend on the model parameters can take different branches during sampling; hence, the compiled tape might be incorrect.
Thus you must not use compiled tapes when your model makes decisions based on the model parameters, and you should be careful if you compute functions of parameters that those functions do not have branching which might cause them to execute different code for different values of the parameter.

Expand Down

0 comments on commit 85c9ca3

Please sign in to comment.