Conversation
|
AdvancedHMC.jl documentation for PR #458 is available at: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #458 +/- ##
==========================================
- Coverage 75.44% 75.42% -0.03%
==========================================
Files 21 21
Lines 1230 1233 +3
==========================================
+ Hits 928 930 +2
- Misses 302 303 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
HISTORY is updated and a minor version is bumped! |
| # The gradient of a position-dependent Hamiltonian system depends on both θ and r. | ||
| ∂H∂θ(h::Hamiltonian, θ::AbstractVecOrMat, r::AbstractVecOrMat) = ∂H∂θ(h, θ) | ||
| ∂H∂r(h::Hamiltonian, θ::AbstractVecOrMat, r::AbstractVecOrMat) = ∂H∂r(h, r) | ||
| function ∂H∂r(h::Hamiltonian, θ::AbstractVecOrMat, r::AbstractVecOrMat) |
There was a problem hiding this comment.
We need to remove these too.
AdvancedHMC.jl/src/riemannian/hamiltonian.jl
Lines 106 to 108 in 5a562e0
| #! Eq (17) of Girolami & Calderhead (2011) | ||
| θ_full = copy(θ_init) | ||
| term_1 = ∂H∂r(h, θ_init, r_half) # unchanged across the loop | ||
| term_1 = ∂H∂r(h, θ_init, r_half).gradient # unchanged across the loop |
There was a problem hiding this comment.
This computes neg_energy but doesn't use it, which has performance implications. Maybe use a different name for functions that returns DualValue, eg: neg_energy_and_∂H∂r.
There was a problem hiding this comment.
Ohh, I suddenly realize the riemannian manifold HMC is not included in AdvancedHMC yet, this file is not included in the package, see
AdvancedHMC.jl/src/AdvancedHMC.jl
Line 50 in 5a562e0
I think we might start with #439, which is ready to get in now.
|
This is mainly reshuffling some internal logic, isn't it? |
|
I think it actually makes more sense to have |
|
That being said, it's actually doubly confusing because even in the Euclidean setting, Instead, AdvancedHMC.jl/src/hamiltonian.jl Lines 44 to 48 in 41c04ab |
|
I don't think this is a change which decreases the the confusingness of AdvancedHMC - see #483. I'd close this PR in favour of a more exhaustive refactor. |
Fix: #173
While
∂H∂θreturn aDualValuecontaining log density and its gradient, this PR makes∂H∂rconsistent with∂H∂θand return aDualValuecontaining negative energy and momentum.This PR also change the weird argumnet order of
neg_energy(h, r, θ)toneg_energy(h, θ, r), which is more commonly used in this package, e.g.phasepoint(h, θ, r),