Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.6.1"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
AdaptiveRejectionSampling = "c75e803d-635f-53bd-ab7d-544e482d8c75"
Copy link
Member

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?

ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
InplaceOps = "505f98c9-085e-5b2c-8e89-488be7bf1f34"
Expand Down Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate with L53.

Suggested change
LinearAlgebra = "1.6"

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]
Expand Down
83 changes: 0 additions & 83 deletions research/src/relativistic_hmc.jl

This file was deleted.

32 changes: 30 additions & 2 deletions src/AdvancedHMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ export Hamiltonian

include("integrator.jl")
export Leapfrog, JitteredLeapfrog, TemperedLeapfrog
include("riemannian/integrator.jl")
export GeneralizedLeapfrog

include("trajectory.jl")
export Trajectory,
Expand Down Expand Up @@ -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!
Copy link
Member

Choose a reason for hiding this comment

The 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")

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
Expand Down