Skip to content

Commit 8f1f7d8

Browse files
committed
Improve docs
1 parent 892b097 commit 8f1f7d8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/logdensityfunction.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ import DifferentiationInterface as DI
1111
A struct which contains a model, along with all the information necessary to:
1212
1313
- calculate its log density at a given point;
14-
- and if `adtype` is provided, calculate the gradient of the log density at that point.
14+
- and if `adtype` is provided, calculate the gradient of the log density at
15+
that point.
1516
1617
At its most basic level, a LogDensityFunction wraps the model together with its
1718
the type of varinfo to be used, as well as the evaluation context. These must
18-
be known in order to calculate the log density (using [`DynamicPPL.evaluate!!`](@ref)).
19-
20-
If the `adtype` keyword argument is provided, then this struct will also
21-
store the adtype along with other information for efficient calculation of the
22-
gradient of the log density.
19+
be known in order to calculate the log density (using
20+
[`DynamicPPL.evaluate!!`](@ref)).
21+
22+
If the `adtype` keyword argument is provided, then this struct will also store
23+
the adtype along with other information for efficient calculation of the
24+
gradient of the log density. Note that preparing a `LogDensityFunction` with an
25+
AD type `AutoBackend()` requires the AD backend itself to have been loaded
26+
(e.g. with `import Backend`).
2327
2428
`DynamicPPL.LogDensityFunction` implements the LogDensityProblems.jl interface.
2529
If `adtype` is nothing, then only `logdensity` is implemented. If `adtype` is a

0 commit comments

Comments
 (0)