tpapp / DynamicHMC.jl

Implementation of robust dynamic Hamiltonian Monte Carlo methods (NUTS) in Julia.
Other
242 stars 21 forks source link

Add a progress bar based on `ProgressMeter.jl` #136

Closed DilumAluthge closed 3 years ago

DilumAluthge commented 3 years ago

Fixes #135

This pull request adds the ProgressMeterReport, which uses the ProgressMeter.jl package to display a progress bar.

To use this reporter, simply set the reporter keyword argument when calling mcmc_with_warmup:

reporter = ProgressMeterReport()

cc: @tpapp

DilumAluthge commented 3 years ago

Alright, this is ready for review now @tpapp

tpapp commented 3 years ago

Thanks. I am very busy now but will try to do it soon. Feel free to bump this if I don't get to it within a week.

DilumAluthge commented 3 years ago

I think I've addressed all the changes!

You will also notice that I have now removed the log_warmup field. This bears some explanation.

Right now, we have separate progress bars for warmup and MCMC. Long-term, I think the best solution will be to figure out how to have a single progress bar for both warmup and MCMC. This will require some more info, e.g. https://github.com/tpapp/DynamicHMC.jl/issues/141

Once we implement that feature, the log_warmup field will no longer make sense. If we add the log_warmup field now, then later, when we are ready to remove it, that would be a breaking change.

So I think it's best to right now remove the log_warmup field, and always generate progress bars for both warmup and MCMC. And then in the future we can work on combining the progress bars for warmup and MCMC into a single progress bar.

tpapp commented 3 years ago

Thanks, I think this is the best solution for now.

I am merging this, but if that is OK with you I will wait for JuliaNLSolvers/Optim.jl#863 to resolve before tagging a new release. If you need that before, just let me know.

DilumAluthge commented 3 years ago

I am merging this, but if that is OK with you I will wait for JuliaNLSolvers/Optim.jl#863 to resolve before tagging a new release. If you need that before, just let me know.

Sounds good to me, there's no time pressure on my part.