-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make DynamicHMC and Turing support into extensions (#114)
* Move integrations to ext folder * Make extensions modules * Use Requires for older Julia versions * Always load Requires * Specify weakdeps and extensions * Increment patch number * Run CI on nightly as well * Only run with 2 threads on latest version * Revert "Only run with 2 threads on latest version" This reverts commit 1b84007. * Revert "Run CI on nightly as well" This reverts commit 1646855. * Simplify job matrix * Run DynamicHMC and Turing integration tests on nightly * Load modules using syntax required by Requires * Add Julia version to name * Require Turing dependencies used * Use double-dot syntax only for conditionally loaded deps * Increment version number
- Loading branch information
Showing
6 changed files
with
81 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Pathfinder" | ||
uuid = "b1d3bc72-d0e7-4279-b92f-7fa5d6d2d454" | ||
authors = ["Seth Axen <[email protected]> and contributors"] | ||
version = "0.7.0" | ||
version = "0.7.1" | ||
|
||
[deps] | ||
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
|
@@ -25,13 +25,25 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" | |
Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999" | ||
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" | ||
|
||
[weakdeps] | ||
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb" | ||
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8" | ||
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" | ||
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" | ||
|
||
[extensions] | ||
DynamicHMCExt = "DynamicHMC" | ||
TuringExt = ["DynamicPPL", "MCMCChains", "Turing"] | ||
|
||
[compat] | ||
Accessors = "0.1" | ||
Distributions = "0.25" | ||
DynamicPPL = "0.20, 0.21" | ||
Folds = "0.2" | ||
ForwardDiff = "0.10" | ||
IrrationalConstants = "0.1.1" | ||
LogDensityProblems = "2" | ||
MCMCChains = "5" | ||
Optim = "1.4" | ||
Optimization = "3" | ||
OptimizationOptimJL = "0.1" | ||
|
@@ -42,12 +54,17 @@ Requires = "1" | |
SciMLBase = "1.8.1" | ||
StatsBase = "0.33" | ||
Transducers = "0.4.5" | ||
Turing = "0.21, 0.22, 0.23" | ||
UnPack = "1" | ||
julia = "1.6" | ||
|
||
[extras] | ||
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb" | ||
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8" | ||
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" | ||
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" | ||
|
||
[targets] | ||
test = ["OptimizationNLopt", "Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module DynamicHMCExt | ||
|
||
using PDMats: PDMats | ||
if isdefined(Base, :get_extension) | ||
using Pathfinder: Pathfinder | ||
using DynamicHMC: DynamicHMC | ||
else # using Requires | ||
using ..Pathfinder: Pathfinder | ||
using ..DynamicHMC: DynamicHMC | ||
end | ||
|
||
function DynamicHMC.GaussianKineticEnergy(M⁻¹::Pathfinder.WoodburyPDMat) | ||
return DynamicHMC.GaussianKineticEnergy(M⁻¹, inv(Pathfinder.pdfactorize(M⁻¹).R)) | ||
end | ||
|
||
function DynamicHMC.kinetic_energy( | ||
κ::DynamicHMC.GaussianKineticEnergy{<:Pathfinder.WoodburyPDMat}, p, q=nothing | ||
) | ||
return PDMats.quad(κ.M⁻¹, p) / 2 | ||
end | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
86b8285
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
86b8285
There was a problem hiding this comment.
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/76806
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: