Skip to content

Commit

Permalink
implement initialstep for prior
Browse files Browse the repository at this point in the history
  • Loading branch information
yebai committed Nov 10, 2023
1 parent 26dcf83 commit d90f49c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mcmc/Inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ DynamicPPL.unflatten(vi::SimpleVarInfo, θ::NamedTuple) = SimpleVarInfo(θ, vi.l
# Algorithm for sampling from the prior
struct Prior <: InferenceAlgorithm end

function DynamicPPL.initialstep(
rng::AbstractRNG,
model::Model,
spl::Sampler{<:Prior},
vi::AbstractVarInfo;
kwargs...
)
return Transition(model, vi), nothing
end

"""
mh_accept(logp_current::Real, logp_proposal::Real, log_proposal_ratio::Real)
Expand Down

0 comments on commit d90f49c

Please sign in to comment.