From c145dfe61f4facd0b9e5d0a6223df392171cc1c9 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Fri, 29 Nov 2024 23:28:35 +0000 Subject: [PATCH] Implement getstepsize() for NoAdaptation samplers --- src/mcmc/hmc.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mcmc/hmc.jl b/src/mcmc/hmc.jl index 5887feb5e..09a434b3f 100644 --- a/src/mcmc/hmc.jl +++ b/src/mcmc/hmc.jl @@ -463,6 +463,12 @@ end getstepsize(sampler::Sampler{<:Hamiltonian}, state) = sampler.alg.ϵ getstepsize(sampler::Sampler{<:AdaptiveHamiltonian}, state) = AHMC.getϵ(state.adaptor) +function getstepsize( + sampler::Sampler{<:AdaptiveHamiltonian}, + state::HMCState{TV,TKernel,THam,PhType,AHMC.Adaptation.NoAdaptation} +) where {TV,TKernel,THam,PhType} + return state.kernel.τ.integrator.ϵ +end gen_metric(dim::Int, spl::Sampler{<:Hamiltonian}, state) = AHMC.UnitEuclideanMetric(dim) function gen_metric(dim::Int, spl::Sampler{<:AdaptiveHamiltonian}, state)