Skip to content

Commit 747ddcd

Browse files
Apply suggestions from code review
Co-authored-by: Will Tebbutt <[email protected]>
1 parent b33d0ae commit 747ddcd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

usage/automatic-differentiation/index.qmd

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pkg.instantiate();
1414

1515
## What is Automatic Differentiation?
1616

17-
Automatic differentiation (AD) is a technique used to evaluate the derivative of a function at a given set of arguments.
17+
Automatic differentiation (AD) is a technique used in Turing.jl to evaluate the gradient of a function at a given set of arguments.
1818
In the context of Turing.jl, the function being differentiated is the log probability density of a model, and the arguments are the parameters of the model (i.e. the values of the random variables).
1919
The gradient of the log probability density is used by various algorithms in Turing.jl, such as HMC (including NUTS), mode estimation (which uses gradient-based optimization), and variational inference.
2020

@@ -26,7 +26,7 @@ For example, to use the [Mooncake.jl](https://github.com/compintell/Mooncake.jl)
2626
using Turing
2727
setprogress!(false)
2828
# Note that if you specify a custom AD backend, you must also import it.
29-
using Mooncake
29+
import Mooncake
3030
3131
@model function f()
3232
x ~ Normal()
@@ -50,7 +50,7 @@ Turing.jl uses the functionality in [DifferentiationInterface.jl](https://github
5050
Thus, in principle, any AD library that has integrations with DI can be used with Turing; you should consult the [DI documentation](https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/stable/) for an up-to-date list of compatible AD libraries.
5151

5252
Note, however, that not all AD libraries in there are tested on Turing models.
53-
Thus, it is likely that some of them will either error (because they don't know how to differentiate through Turing's code), or might silently give incorrect results.
53+
Thus, it is likely that some of them will either error (because they don't know how to differentiate through Turing's code), or maybe even silently give incorrect results (if you are very unlucky).
5454

5555
Formally, our working model is that we have several _tiers_ of integration with AD libraries.
5656
Generally, we recommend that users choose AD libraries that are in **Tier 2 or above**.

0 commit comments

Comments
 (0)