-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress bar #53
Comments
Believe it or not there is actually already a progress bar- it just doesn't work due to upstream issues (TuringLang/AbstractMCMC.jl#24, JuliaLogging/ProgressLogging.jl#27, JuliaLogging/ProgressLogging.jl#32). I am working on a better solution that also prints out convergence information as part of #46. For now, this is how I hook up a progress bar with ProgressMeter.jl using the callback interface using ProgressMeter
using StatsFuns: logaddexp
function conv_callback(rng, m, sampler, t, iteration; pbar, dlogz=0.5, kwargs...)
# Don't accidentally short-circuit
iteration > 2 || return false
logz_remain = maximum(sampler.active_logl) - (iteration - 1) / sampler.nactive
dlogz_current = logaddexp(sampler.logz, logz_remain) - sampler.logz
ProgressMeter.update!(pbar, dlogz_current)
return dlogz_current < dlogz
end
ns = Nested(3, 500)
out = sample(model, ns, conv_callback; pbar=ProgressThresh(0.5, "ΔlnZ = ")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! Is there an easy way to add a progress bar to monitor sampling? If not, it would be great to add this using e.g. ProgressMeter.jl.
The text was updated successfully, but these errors were encountered: