Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mhauru committed Jun 7, 2024
1 parent f6d1712 commit 43e70cf
Show file tree
Hide file tree
Showing 8 changed files with 1,009 additions and 1,009 deletions.
4 changes: 2 additions & 2 deletions benchmarks/benchmarks_suite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ using LinearAlgebra
const BenchmarkSuite = BenchmarkTools.BenchmarkGroup()

#
# Add models to benchmarks
# Add models to benchmarks
#

include("models/hlr.jl")
include("models/lr.jl")
include("models/sv_nuts.jl")

# constrained
# constrained
BenchmarkSuite["constrained"] = BenchmarkGroup(["constrained"])

data = [0, 1, 0, 1, 1, 1, 1, 1, 1, 1]
Expand Down
2,000 changes: 1,000 additions & 1,000 deletions benchmarks/models/lr_nuts.data

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/mcmc/Inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Return a named tuple of parameters.
getparams(model, t) = t.θ
function getparams(model::DynamicPPL.Model, vi::DynamicPPL.VarInfo)
# NOTE: In the past, `invlink(vi, model)` + `values_as(vi, OrderedDict)` was used.
# Unfortunately, using `invlink` can cause issues in scenarios where the constraints
# Unfortunately, using `invlink` can cause issues in scenarios where the constraints
# of the parameters change depending on the realizations. Hence we have to use
# `values_as_in_model`, which re-runs the model and extracts the parameters
# as they are seen in the model, i.e. in the constrained space. Moreover,
Expand Down
2 changes: 1 addition & 1 deletion src/mcmc/particle_mcmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ function trace_local_varinfo_maybe(varinfo)
trace = AdvancedPS.current_trace()
return trace.model.f.varinfo
catch e
# NOTE: this heuristic allows Libtask evaluating a model outside a `Trace`.
# NOTE: this heuristic allows Libtask evaluating a model outside a `Trace`.
if e == KeyError(:__trace) || current_task().storage isa Nothing
return varinfo
else
Expand Down
2 changes: 1 addition & 1 deletion test/mcmc/hmc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ using Turing
initial_params=[0.5, 1.75, 1.0]
)
chain_prior = sample(model, Prior(), num_samples)

# Extract the `x` like this because running `generated_quantities` was how
# the issue was discovered, hence we also want to make sure that it works.
results = generated_quantities(model, chain)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ end
@timeit_include("mcmc/ess.jl")
@timeit_include("mcmc/is.jl")
end

@timeit TIMEROUTPUT "inference" begin
@testset "inference with samplers" begin
@timeit_include("mcmc/gibbs.jl")
Expand Down
4 changes: 2 additions & 2 deletions test/skipped/advi_demo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ for seed in seeds
# Eq. (90) in "Conjugate Bayesian analysis of the Gaussian distribution" by Murphy
# `scale(post)` = θ
p_τ = Gamma(post.shape, scale(post))
p_σ²_pdf = z -> pdf(p_τ, 1 / z) # τ => 1 / σ²
p_σ²_pdf = z -> pdf(p_τ, 1 / z) # τ => 1 / σ²

# marginal of μ
# Eq. (91) in "Conjugate Bayesian analysis of the Gaussian distribution" by Murphy
Expand All @@ -102,7 +102,7 @@ for seed in seeds
βₙ = post.rate # β → rate

# numerically more stable but doesn't seem to have effect; issue is probably internal to
# `pdf` which needs to compute ≈ Γ(1000)
# `pdf` which needs to compute ≈ Γ(1000)
p_μ_pdf =
z -> exp(
logpdf(
Expand Down
2 changes: 1 addition & 1 deletion test/variational/advi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ using Turing.Essential: TuringDiagMvNormal
x ~ Dirichlet([1.0,1.0])
return x
end

m = dirichlet()
b = bijector(m)
x0 = m()
Expand Down

0 comments on commit 43e70cf

Please sign in to comment.