Skip to content

Commit d796ad5

Browse files
committed
Fix docstring again
1 parent 2fdc364 commit d796ad5

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

src/test_utils/ad.jl

+23-16
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,18 @@ There are two positional arguments, which absolutely must be provided:
9494
9595
Everything else is optional, and can be categorised into several groups:
9696
97-
1. _How to specify the VarInfo._ DynamicPPL contains several different types of
98-
VarInfo objects which change the way model evaluation occurs. If you want to
99-
use a specific type of VarInfo, pass it as the `varinfo` argument.
100-
Otherwise, it will default to using a `TypedVarInfo` generated from the
101-
model.
97+
1. _How to specify the VarInfo._
10298
103-
2. _How to specify the parameters._ For maximum control over this, generate a
104-
vector of parameters yourself and pass this as the `params` argument. If you
105-
don't specify this, it will be taken from the contents of the VarInfo.
99+
DynamicPPL contains several different types of VarInfo objects which change
100+
the way model evaluation occurs. If you want to use a specific type of
101+
VarInfo, pass it as the `varinfo` argument. Otherwise, it will default to
102+
using a `TypedVarInfo` generated from the model.
103+
104+
2. _How to specify the parameters._
105+
106+
For maximum control over this, generate a vector of parameters yourself and
107+
pass this as the `params` argument. If you don't specify this, it will be
108+
taken from the contents of the VarInfo.
106109
107110
Note that if the VarInfo is not specified (and thus automatically generated)
108111
the parameters in it will have been sampled from the prior of the model. If
@@ -116,9 +119,10 @@ Everything else is optional, and can be categorised into several groups:
116119
prep_params)`. You could then evaluate the gradient at a different set of
117120
parameters using the `params` keyword argument.
118121
119-
3. _How to specify the results to compare against._ (Only if `test=true`.) Once
120-
logp and its gradient has been calculated with the specified `adtype`, it
121-
must be tested for correctness.
122+
3. _How to specify the results to compare against._ (Only if `test=true`.)
123+
124+
Once logp and its gradient has been calculated with the specified `adtype`,
125+
it must be tested for correctness.
122126
123127
This can be done either by specifying `reference_adtype`, in which case logp
124128
and its gradient will also be calculated with this reference in order to
@@ -130,12 +134,15 @@ Everything else is optional, and can be categorised into several groups:
130134
The default reference backend is ForwardDiff. If none of these parameters are
131135
specified, ForwardDiff will be used to calculate the ground truth.
132136
133-
4. _How to specify the tolerances._ (Only if `test=true`.) The tolerances for
134-
the value and gradient can be set using `value_atol` and `grad_atol`. These
135-
default to 1e-6.
137+
4. _How to specify the tolerances._ (Only if `test=true`.)
138+
139+
The tolerances for the value and gradient can be set using `value_atol` and
140+
`grad_atol`. These default to 1e-6.
141+
142+
5. _Whether to output extra logging information._
136143
137-
5. _Whether to output extra logging information._ By default, this function
138-
prints a message when it runs. To silence it, set `verbose=false`.
144+
By default, this function prints messages when it runs. To silence it, set
145+
`verbose=false`.
139146
"""
140147
function run_ad(
141148
model::Model,

0 commit comments

Comments
 (0)