Skip to content

Commit

Permalink
Bugfix and minor tweaks of test settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
yebai committed Jul 31, 2023
1 parent 4f6fde8 commit 8bdb40c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/inference/gibbs.jl
Expand Up @@ -67,8 +67,7 @@ function Gibbs(
arg1::Union{Tuple{<:InferenceAlgorithm,Int}, Pair{<:InferenceAlgorithm,Int}},
argrest::Vararg{<:Union{Tuple{<:InferenceAlgorithm,Int}, Pair{<:InferenceAlgorithm,Int}}, N},
) where {N}
args = (arg1, argrest...)
allargs = (arg, args...)
allargs = (arg1, argrest...)
algs = map(first, allargs)
iterations = map(last, allargs)

Check warning on line 72 in src/inference/gibbs.jl

View check run for this annotation

Codecov / codecov/patch

src/inference/gibbs.jl#L70-L72

Added lines #L70 - L72 were not covered by tests
# obtain space of sampling algorithms
Expand Down
9 changes: 5 additions & 4 deletions test/inference/gibbs.jl
Expand Up @@ -55,12 +55,13 @@
chain = sample(MoGtest_default, gibbs, 10_000)
check_MoGtest_default(chain, atol=0.15)

Random.seed!(200)
for alg in [
Gibbs((MH(:s), 10), (HMC(0.2, 4, :m), 10)),
Gibbs(MH(:s) => 10, HMC(0.2, 4, :m) => 10),
Gibbs((MH(:s), 2), (HMC(0.2, 4, :m), 1)),
Gibbs(MH(:s) => 1, HMC(0.2, 4, :m) => 2),
]
chain = sample(gdemo(1.5, 2.0), alg, 5_000)
check_gdemo(chain; atol=0.1)
chain = sample(gdemo(1.5, 2.0), alg, 10_000)
check_gdemo(chain; atol=0.15)
end
end

Expand Down

0 comments on commit 8bdb40c

Please sign in to comment.