Skip to content

Commit 989d284

Browse files
committed
fix some stray tests
1 parent 7cdea36 commit 989d284

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/adaptation/massmatrix.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ function adapt!(
6060
return nothing
6161
end
6262

63+
function adapt!(
64+
::UnitMassMatrix,
65+
::PhasePoint,
66+
::AbstractScalarOrVec{<:AbstractFloat},
67+
is_update::Bool=true,
68+
)
69+
return nothing
70+
end
71+
6372
## Diagonal mass matrix adaptor
6473

6574
abstract type DiagMatrixEstimator{T} <: MassMatrixAdaptor end

test/adaptation.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ preconditioned_cond(a::DiagMatrixEstimator, cov::AbstractMatrix) = cond(sqrt(Dia
104104
LinearAlgebra.diagm(0 => ones(length(θ)))
105105

106106
# Making sure "all" MassMatrixAdaptors support getting a PhasePoint instead of a Vector
107-
# AdvancedHMC.adapt!(pc1, z, 1.0) - this does not work - should it?
107+
AdvancedHMC.adapt!(pc1, z, 1.0)
108108
AdvancedHMC.adapt!(pc2, z, 1.0)
109109
AdvancedHMC.adapt!(pc2_nutpie, z, 1.0)
110110
AdvancedHMC.adapt!(pc3, z, 1.0)
@@ -201,7 +201,6 @@ preconditioned_cond(a::DiagMatrixEstimator, cov::AbstractMatrix) = cond(sqrt(Dia
201201
# find the best preconditioner for the target.
202202
# As these are statistical algorithms, superiority is not always guaranteed, hence this way of testing.
203203
res_nutpie = runnuts_nutpie(ℓπ, DiagEuclideanMetric(D))
204-
# @test res.adaptor.pc.var ≈ diag(Σ) rtol = 0.2
205204
n_nutpie_superior += preconditioned_cond(res_nutpie.adaptor.pc, Σ) < preconditioned_cond(res.adaptor.pc, Σ)
206205

207206
res = runnuts(ℓπ, DenseEuclideanMetric(D))

0 commit comments

Comments
 (0)