-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Loading from a backend #2195
Comments
Thanks for reporting -- I'm closing to consolidate discussion to #2189, but it is helpful to know that you're using the backends and that this is one of the problems. the tl;dr: Adding hamiltonian monte carlo samplers means that there is less reason to persist the trace to disk (since you can get a good sample in memory), and the backends are a holdover from pymc2 when this wasn't the case. For this reason, we're considering deprecating the backends in favor of only supporting ndarrays, and adding utilities for reading/writing to disk. If you are running this on your own machine, the suggestion in the other issue to use |
I am still skeptical of the idea that one can do away with burn-in, sub-sampling, and disk persistence entirely. It's nice to be able to serialize results for later consumption, possibly to have separate scripts for sampling and model generation and for downstream analysis. |
The part that I object to is that while sampling at every step there is a call to What has been discussed is getting rid of that, and only supporting serializing the resulting trace to disk, which sounds like addresses your concerns? |
SGTM |
Currently, I like to use the
|
@fonnesbeck But how can you load traces back into a trace object? |
I don't usually load them back into their objects. Typically, I am generating output from many, many runs and then, for example, generating faceted plots in Seaborn with them, or some other type of post-processing. So, data frames are what I want. |
I am new to pymc3, and have an issue loading a saved trace. I have a simple model with two variables, of the form:
I run the model, and save the trace using the Text backend:
I then have a data file with 4 columns, theta_interval_, sigma_log_, theta, sigma. When I then try to load the trace, I get a MultiTrace object with 0 variables:
Results in:
<MultiTrace: 1 chains, 1348 iterations, 0 variables>
I cannot use this MultiTrace object, if I simply try to plot the data, I get
ValueError: zero-size array to reduction operation maximum which has no identity
I also cannot extract the variables from the loaded trace, even though when I view the data, I see it has saved correctly. Is there an issue with loading a text backend, or is there a problem with how I am trying to load it? I have also tried using the SQL backend with similar results.
The text was updated successfully, but these errors were encountered: