Skip to content

Commit 175b633

Browse files
committed
Fix a few typos
1 parent 59e22a2 commit 175b633

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/logdensityfunction.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ julia> LogDensityProblems.logdensity(f, [0.0])
8080
-2.3378770664093453
8181
8282
julia> # One can also specify evaluating e.g. the log prior only:
83-
f_prior = LogDensityFunction(model, getprior);
83+
f_prior = LogDensityFunction(model, getlogprior);
8484
8585
julia> LogDensityProblems.logdensity(f_prior, [0.0]) == logpdf(Normal(), 0.0)
8686
true

src/test_utils/ad.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using ADTypes: AbstractADType, AutoForwardDiff
44
using Chairmarks: @be
55
import DifferentiationInterface as DI
66
using DocStringExtensions
7-
using DynamicPPL: Model, LogDensityFunction, VarInfo, AbstractVarInfo, link
7+
using DynamicPPL: Model, LogDensityFunction, VarInfo, AbstractVarInfo, getlogjoint, link
88
using LogDensityProblems: logdensity, logdensity_and_gradient
99
using Random: Random, Xoshiro
1010
using Statistics: median
@@ -184,7 +184,7 @@ function run_ad(
184184

185185
verbose && @info "Running AD on $(model.f) with $(adtype)\n"
186186
verbose && println(" params : $(params)")
187-
ldf = LogDensityFunction(model, varinfo; adtype=adtype)
187+
ldf = LogDensityFunction(model, getlogjoint, varinfo; adtype=adtype)
188188

189189
value, grad = logdensity_and_gradient(ldf, params)
190190
grad = collect(grad)
@@ -193,7 +193,9 @@ function run_ad(
193193
if test
194194
# Calculate ground truth to compare against
195195
value_true, grad_true = if expected_value_and_grad === nothing
196-
ldf_reference = LogDensityFunction(model, varinfo; adtype=reference_adtype)
196+
ldf_reference = LogDensityFunction(
197+
model, getlogjoint, varinfo; adtype=reference_adtype
198+
)
197199
logdensity_and_gradient(ldf_reference, params)
198200
else
199201
expected_value_and_grad

0 commit comments

Comments
 (0)