Skip to content

Commit

Permalink
Test HMCDA in Gibbs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mhauru committed Nov 28, 2024
1 parent d22df39 commit 2025ef9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/mcmc/gibbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ end
# As above but using a Dict of VarNames.
s4 = Gibbs(Dict(@varname(s) => PG(3), @varname(m) => HMC(0.4, 8; adtype=adbackend)))
# As above but different samplers and using kwargs.
s5 = Gibbs(; s=CSMC(3), m=HMC(0.4, 8; adtype=adbackend))
s5 = Gibbs(; s=CSMC(3), m=HMCDA(200, 0.65, 0.15; adtype=adbackend))
s6 = Gibbs(; s=HMC(0.1, 5; adtype=adbackend), m=ESS())
s7 = Gibbs(Dict((:s, @varname(m)) => PG(10)))
# Multiple instnaces of the same sampler. This implements running, in this case,
Expand Down Expand Up @@ -347,7 +347,7 @@ end

Random.seed!(100)

alg = Gibbs(; s=MH(), m=HMC(0.2, 4; adtype=adbackend))
alg = Gibbs(; s=MH(), m=HMCDA(200, 0.65, 0.3; adtype=adbackend))
chain = sample(gdemo(1.5, 2.0), alg, 10_000)
check_numerical(chain, [:s, :m], [49 / 24, 7 / 6]; atol=0.1)

Expand Down
4 changes: 2 additions & 2 deletions test/mcmc/repeat_sampler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ using StableRNGs: StableRNG
using Test: @test, @testset
using Turing

# RepeatedSampler only really makes sense as a component sampler of Gibbs.
# RepeatSampler only really makes sense as a component sampler of Gibbs.
# Here we just check that running it by itself is equivalent to thinning.
@testset "RepeatedSampler" begin
@testset "RepeatSampler" begin
num_repeats = 17
num_samples = 10
num_chains = 2
Expand Down

0 comments on commit 2025ef9

Please sign in to comment.