-
Notifications
You must be signed in to change notification settings - Fork 18
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
Convergence Logging #24
Comments
Do you have an example for what you tried and how it failed? |
Inside my default convergence method: # logging; don't even try to print every time
if progress && iszero(iteration % 10)
print("dlogz threshold: $(dlogz_current) --> $(dlogz)\r")
end I also tried printing to Convergence sampling 100%|███████████████████████████████████████████████████████████████████████████████████| Time: 0:00:00 (this is not different during the sampling, either) I've also tried switching the carriage return to the beginning of the string instead of the end, with no improvement. I have tested using a basic for-loop that printing with a carriage return works for "logging", so I'm fairly confident the context is killing it. |
Sorry, it's still unclear to me where exactly you put these lines of code and how you called them. Do you have a MWE or a link to a repo? |
This is a function that is being passed to |
Ah OK, and do you have a MWE that I can run to reproduce the issue? |
using NestedSamplers, StatsBase
priors = [Uniform(0, 1)]
model = NestedModel(p->rand(), priors)
samples = sample(model, Nested(10), dlogz=1e-5, chain_type=Array) It should "freeze" a little to show both during sampling and after sampling outputs |
See also: JuliaLogging/ProgressLogging.jl#27 |
Thanks for the MWE, I'll have a look at it. In principle, I think the right approach is to add support for convergence based logging upstream in ProgressLogging, as you already suggested, in a similar way as also the possibility to print additional information should preferably be added upstream (see JuliaLogging/ProgressLogging.jl#23). |
Right now logging in the convergence sampling mode is almost useless. The
@logprogress
requires passing a fraction from 0 to 1, which isn't conducive to convergence logging at all. I realize this is backed up into the design of ProgressLogging.jl, which is even further backed up into the current logging backends, some parts end up tied directly into base julia. I've tried circumventing the issue by printing out my own statements but they actually get gobbled up due to the@withprogresslogging
context.I'm not sure the best path forward, other than re-introducing the ProgressMeter.jl dependency only for those sampling routines.
The text was updated successfully, but these errors were encountered: