From 3e333f7d1460b7f60a6209878103f1134f0d1d3e Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Thu, 16 May 2024 18:54:16 +0100 Subject: [PATCH] rename `num_adapts` to `num_unadjusted` --- src/AutomaticMALA.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AutomaticMALA.jl b/src/AutomaticMALA.jl index 25c2110..482b8fe 100644 --- a/src/AutomaticMALA.jl +++ b/src/AutomaticMALA.jl @@ -11,7 +11,7 @@ export AutoMALA struct AutoMALA{T} <: AbstractMCMC.AbstractSampler ϵ_init::T - num_adapt::Int + num_unadjusted::Int end struct AutoMALAState{T1,T2,T3} @@ -26,7 +26,7 @@ struct AutoMALAState{T1,T2,T3} iteration::Int end -isadapt(sampler::AutoMALA, state::AutoMALAState) = state.iteration < sampler.num_adapt +isunadjusted(sampler::AutoMALA, state::AutoMALAState) = state.iteration < sampler.num_unadjusted function compute_logprob(model, x, p) ℓ_x = LogDensityProblems.logdensity(model, x) @@ -83,7 +83,7 @@ function AbstractMCMC.step( # Compute acceptance probability. logα = lp - lp_prev # Accept or reject. - isaccept = isadapt(sampler, state) || (j == j_prop && log(rand(rng)) < logα) + isaccept = isunadjusted(sampler, state) || (j == j_prop && log(rand(rng)) < logα) state_new = if isaccept AutoMALAState(x, p, lp, a, b, ϵₜ, j, isaccept, state.iteration + 1)