Skip to content

Commit

Permalink
undo formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxd3 committed Oct 21, 2024
1 parent eedb02f commit f340df7
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions test/abstractmcmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Statistics: mean
θ_init = randn(rng, 2)

nuts = NUTS(0.8)
hmc = HMC(100; integrator=Leapfrog(0.05))
hmc = HMC(100; integrator = Leapfrog(0.05))
hmcda = HMCDA(0.8, 0.1)

integrator = Leapfrog(1e-3)
Expand Down Expand Up @@ -38,10 +38,10 @@ using Statistics: mean
model,
nuts,
n_adapts + n_samples;
n_adapts=n_adapts,
initial_params=θ_init,
progress=false,
verbose=false,
n_adapts = n_adapts,
initial_params = θ_init,
progress = false,
verbose = false,
)

# Error if keyword argument `nadapts` is used
Expand All @@ -50,10 +50,10 @@ using Statistics: mean
model,
nuts,
n_adapts + n_samples;
nadapts=n_adapts,
initial_params=θ_init,
progress=false,
verbose=false,
nadapts = n_adapts,
initial_params = θ_init,
progress = false,
verbose = false,
)
@test_throws ArgumentError AbstractMCMC.sample(
rng,
Expand All @@ -62,10 +62,10 @@ using Statistics: mean
MCMCThreads(),
n_adapts + n_samples,
2;
nadapts=n_adapts,
initial_params=θ_init,
progress=false,
verbose=false,
nadapts = n_adapts,
initial_params = θ_init,
progress = false,
verbose = false,
)

# Transform back to original space.
Expand All @@ -85,10 +85,10 @@ using Statistics: mean
model,
hmc,
n_adapts + n_samples;
n_adapts=n_adapts,
initial_params=θ_init,
progress=false,
verbose=false,
n_adapts = n_adapts,
initial_params = θ_init,
progress = false,
verbose = false,
)

# Transform back to original space.
Expand All @@ -108,10 +108,10 @@ using Statistics: mean
model,
custom,
n_adapts + n_samples;
n_adapts=0,
initial_params=θ_init,
progress=false,
verbose=false,
n_adapts = 0,
initial_params = θ_init,
progress = false,
verbose = false,
)

# Transform back to original space.
Expand All @@ -134,20 +134,20 @@ using Statistics: mean
model,
custom,
10;
n_adapts=0,
initial_params=θ_init,
progress=false,
verbose=false,
n_adapts = 0,
initial_params = θ_init,
progress = false,
verbose = false,
)
samples2 = AbstractMCMC.sample(
rng2,
model,
custom,
10;
n_adapts=0,
initial_params=θ_init,
progress=false,
verbose=false,
n_adapts = 0,
initial_params = θ_init,
progress = false,
verbose = false,
)
@test mapreduce(*, samples1, samples2) do s1, s2
s1.z.θ == s2.z.θ
Expand Down

0 comments on commit f340df7

Please sign in to comment.