-
Notifications
You must be signed in to change notification settings - Fork 46
general relativistic HMC #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
7fc04d2
3813ba0
8805885
6b023f7
3bbb17f
cdef753
4ff42cf
1acbf8f
f446f0e
62077db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -4,6 +4,7 @@ version = "0.6.1" | |||
|
||||
[deps] | ||||
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" | ||||
AdaptiveRejectionSampling = "c75e803d-635f-53bd-ab7d-544e482d8c75" | ||||
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197" | ||||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||||
InplaceOps = "505f98c9-085e-5b2c-8e89-488be7bf1f34" | ||||
|
@@ -31,23 +32,24 @@ AdvancedHMCOrdinaryDiffEqExt = "OrdinaryDiffEq" | |||
|
||||
[compat] | ||||
AbstractMCMC = "4.2, 5" | ||||
AdaptiveRejectionSampling = "0.1.1" | ||||
ArgCheck = "1, 2" | ||||
CUDA = "3, 4, 5" | ||||
DocStringExtensions = "0.8, 0.9" | ||||
InplaceOps = "0.3" | ||||
LinearAlgebra = "1.6" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate with L53.
Suggested change
|
||||
LogDensityProblems = "2" | ||||
LogDensityProblemsAD = "1" | ||||
MCMCChains = "5, 6" | ||||
OrdinaryDiffEq = "6" | ||||
ProgressMeter = "1" | ||||
Random = "1.6" | ||||
Requires = "0.5, 1" | ||||
Setfield = "0.7, 0.8, 1" | ||||
SimpleUnPack = "1.1" | ||||
Statistics = "1.6" | ||||
StatsBase = "0.31, 0.32, 0.33, 0.34" | ||||
StatsFuns = "0.8, 0.9, 1" | ||||
LinearAlgebra = "1.6" | ||||
Random = "1.6" | ||||
julia = "1.6" | ||||
|
||||
[extras] | ||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,8 +52,6 @@ export Hamiltonian | |
|
||
include("integrator.jl") | ||
export Leapfrog, JitteredLeapfrog, TemperedLeapfrog | ||
include("riemannian/integrator.jl") | ||
export GeneralizedLeapfrog | ||
|
||
include("trajectory.jl") | ||
export Trajectory, | ||
|
@@ -128,6 +126,36 @@ export sample | |
include("constructors.jl") | ||
export HMCSampler, HMC, NUTS, HMCDA | ||
|
||
module Experimental | ||
using Random, Statistics, LinearAlgebra | ||
using ..AdvancedHMC | ||
|
||
import ..AdvancedHMC: ∂H∂r, neg_energy, AbstractKinetic | ||
import Random: AbstractRNG | ||
include("relativistic/hamiltonian.jl") | ||
export RelativisticKinetic, DimensionwiseRelativisticKinetic | ||
|
||
using AdaptiveRejectionSampling: RejectionSampler, run_sampler! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider turning ARS into an AHMCARSext extension so ARS is a weak dep. See also the above comment about ARS. |
||
import ..AdvancedHMC: _rand | ||
include("relativistic/metric.jl") | ||
xukai92 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
using ..AdvancedHMC: | ||
@unpack, TYPEDEF, TYPEDFIELDS, AbstractScalarOrVec, AbstractLeapfrog, step, step_size | ||
import ..AdvancedHMC: ∂H∂θ, ∂H∂r, DualValue, PhasePoint, phasepoint, step | ||
include("riemannian/integrator.jl") | ||
export GeneralizedLeapfrog | ||
|
||
import AdvancedHMC: _rand | ||
using AdvancedHMC: AbstractMetric, PhasePoint | ||
using LinearAlgebra: eigen, cholesky, Symmetric, Diagonal | ||
include("riemannian/metric.jl") | ||
export DenseRiemannianMetric | ||
|
||
import AdvancedHMC: DualValue, phasepoint, neg_energy, ∂H∂θ, ∂H∂r | ||
using LinearAlgebra: logabsdet, tr | ||
include("riemannian/hamiltonian.jl") | ||
end | ||
|
||
include("abstractmcmc.jl") | ||
|
||
## Without explicit AD backend | ||
|
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.
A minor issue: Do we want to depend on
ARS
? Is it possible to turn this into a weak deps?