Skip to content

Commit

Permalink
fix subsampling example to work with DoG (tweaked scale_eps)
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Portal committed Sep 10, 2024
1 parent d8d6f56 commit 2fe0061
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/subsampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ using ForwardDiff, ADTypes, Optimisers, Plots
μ_true = mean([mean(component) for component in prob.dists])
Σsqrt_true = sqrt(Σ_true)
q0 = MeanFieldGaussian(zeros(n_dims), Diagonal(ones(n_dims)))
q0 = MvLocationScale(zeros(n_dims), Diagonal(ones(n_dims)), Normal(); scale_eps=1e-3)
adtype = AutoForwardDiff()
optimizer = Adam(0.01)
optimizer = DoG()
averager = PolynomialAveraging()
function callback(; averaged_params, restructure, kwargs...)
Expand All @@ -106,7 +106,7 @@ function callback(; averaged_params, restructure, kwargs...)
(dist = sqrt(dist2),)
end
n_iters = 3*10^2
n_iters = 10^3
_, q, stats_full, _ = optimize(
prob, full_obj, q0, n_iters; optimizer, averager, show_progress=false, adtype, callback,
)
Expand Down

0 comments on commit 2fe0061

Please sign in to comment.