Skip to content

Commit

Permalink
Add isnan(::PhasePoint)
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm committed Nov 5, 2024
1 parent 5d56902 commit 0272874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AdvancedHMC"
uuid = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
version = "0.6.3"
version = "0.6.4"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Expand Down
4 changes: 4 additions & 0 deletions src/hamiltonian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ Base.isfinite(v::DualValue) = all(isfinite, v.value) && all(isfinite, v.gradient
Base.isfinite(v::AbstractVecOrMat) = all(isfinite, v)
Base.isfinite(z::PhasePoint) = isfinite(z.ℓπ) && isfinite(z.ℓκ)

Base.isnan(v::DualValue) = any(isnan, v.value) || any(isnan, v.gradient)
Base.isnan(v::AbstractVecOrMat) = any(isnan, v)
Base.isnan(z::PhasePoint) = isnan(z.ℓπ) || isnan(z.ℓκ)

###
### Negative energy (or log probability) functions.
### NOTE: the general form (i.e. non-Euclidean) of K depends on both θ and r.
Expand Down

0 comments on commit 0272874

Please sign in to comment.