Skip to content

Commit d2c1c92

Browse files
committed
More fixes; I think the remaining failures are pMCMC related
1 parent 98e70c2 commit d2c1c92

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/Turing.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ using DynamicPPL:
7171
unfix,
7272
prefix,
7373
conditioned,
74-
@submodel,
7574
to_submodel,
7675
LogDensityFunction,
7776
@addlogprob!
@@ -81,7 +80,6 @@ using OrderedCollections: OrderedDict
8180
# Turing essentials - modelling macros and inference algorithms
8281
export
8382
# DEPRECATED
84-
@submodel,
8583
generated_quantities,
8684
# Modelling - AbstractPPL and DynamicPPL
8785
@model,

src/mcmc/emcee.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ function AbstractMCMC.step(
8585
# Generate a log joint function.
8686
vi = state.vi
8787
densitymodel = AMH.DensityModel(
88-
Base.Fix1(LogDensityProblems.logdensity, DynamicPPL.LogDensityFunction(model, vi))
88+
Base.Fix1(
89+
LogDensityProblems.logdensity,
90+
DynamicPPL.LogDensityFunction(model, DynamicPPL.getlogjoint, vi),
91+
),
8992
)
9093

9194
# Compute the next states.

src/mcmc/ess.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ struct ESSLikelihood{M<:Model,V<:AbstractVarInfo}
106106
ldf::DynamicPPL.LogDensityFunction{M,V}
107107

108108
# Force usage of `getloglikelihood` in inner constructor
109-
function ESSLogLikelihood(model::Model, varinfo::AbstractVarInfo)
109+
function ESSLikelihood(model::Model, varinfo::AbstractVarInfo)
110110
ldf = DynamicPPL.LogDensityFunction(model, DynamicPPL.getloglikelihood, varinfo)
111111
return new{typeof(model),typeof(varinfo)}(ldf)
112112
end

src/mcmc/sghmc.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function DynamicPPL.initialstep(
6161
# Transform the samples to unconstrained space and compute the joint log probability.
6262
if !DynamicPPL.islinked(vi)
6363
vi = DynamicPPL.link!!(vi, model)
64-
vi = last(DynamicPPL.evaluate!!(model, vi, DynamicPPL.SamplingContext(rng, spl)))
64+
vi = last(DynamicPPL.evaluate!!(model, vi))
6565
end
6666

6767
# Compute initial sample and state.
@@ -100,7 +100,7 @@ function AbstractMCMC.step(
100100

101101
# Save new variables and recompute log density.
102102
vi = DynamicPPL.unflatten(vi, θ)
103-
vi = last(DynamicPPL.evaluate!!(model, vi, DynamicPPL.SamplingContext(rng, spl)))
103+
vi = last(DynamicPPL.evaluate!!(model, vi))
104104

105105
# Compute next sample and state.
106106
sample = Transition(model, vi)
@@ -224,7 +224,7 @@ function DynamicPPL.initialstep(
224224
# Transform the samples to unconstrained space and compute the joint log probability.
225225
if !DynamicPPL.islinked(vi)
226226
vi = DynamicPPL.link!!(vi, model)
227-
vi = last(DynamicPPL.evaluate!!(model, vi, DynamicPPL.SamplingContext(rng, spl)))
227+
vi = last(DynamicPPL.evaluate!!(model, vi))
228228
end
229229

230230
# Create first sample and state.
@@ -254,7 +254,7 @@ function AbstractMCMC.step(
254254

255255
# Save new variables and recompute log density.
256256
vi = DynamicPPL.unflatten(vi, θ)
257-
vi = last(DynamicPPL.evaluate!!(model, vi, DynamicPPL.SamplingContext(rng, spl)))
257+
vi = last(DynamicPPL.evaluate!!(model, vi))
258258

259259
# Compute next sample and state.
260260
sample = SGLDTransition(model, vi, stepsize)

0 commit comments

Comments
 (0)