Skip to content

Commit

Permalink
Merge pull request #259 from SciML/dw/dynamichmc
Browse files Browse the repository at this point in the history
Account for changes in DynamicHMC 3.3.0
  • Loading branch information
Vaibhavdixit02 authored Sep 6, 2022
2 parents dfba687 + 7c7169e commit 06b6c31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DiffEqBayes"
uuid = "ebbdde9d-f333-5424-9be2-dbf1e9acfb5e"
authors = ["Vaibhavdixit02 <[email protected]>"]
version = "3.0.0"
version = "3.0.1"

[deps]
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Expand Down
8 changes: 7 additions & 1 deletion src/dynamichmc_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,11 @@ function dynamichmc_inference(problem::DiffEqBase.DEProblem, algorithm, t, data,
= TransformedLogDensity(trans, P)
∇ℓ = LogDensityProblems.ADgradient(AD_gradient_kind, ℓ)
results = mcmc_with_warmup(rng, ∇ℓ, num_samples; mcmc_kwargs...)
merge((posterior = TransformVariables.transform.(Ref(trans), results.chain),), results)
chain = if haskey(results, :chain) # DynamicHMC < 3.3.0
results.chain
else
eachcol(results.posterior_matrix)
end
posterior = map(Base.Fix1(TransformVariables.transform, trans), chain)
merge((; posterior), results)
end

2 comments on commit 06b6c31

@devmotion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/67767

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.0.1 -m "<description of version>" 06b6c31335c8bc74815d5cdc253e3564e7dccb9c
git push origin v3.0.1

Please sign in to comment.