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
Add information from model to fit #75
Comments
I'd like to keep things as simple as possible, in the interest of making
the code very easy/pleasant to read.
Perhaps we could wait until someone asks for this explicitly?
…On 6/2/19 3:36 AM, Ari Hartikainen wrote:
Hi,
could we add |model.program_code| maybe other information too, so one
can infer the model and recreate the model without model instance.
They could to dict under |fit.model_info|?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#75>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJQUBVS5R2L64WL4J7TITJDPYNZ6ZANCNFSM4HSCCQIA>.
|
True. Could we atleast add This could also simplify the implementation in arviz. |
How about storing a copy of |
That could work, but fails when user incrementally updates model, overwriting the old model. I don't think |
I have trouble imagining a scenario where I would lose track of my Stan program code. (I like the idea of storing the So here are my two arguments against adding the program code to the Fit object:
If people are losing track of their Models, then this is a problem and we should find out a way to help them. I can imagine some sort of helper function which bundles Model and Fits together. We could add this helper function to the documentation just like we did with Edit: edits for clarity |
Scikit-learn keeps model and fit in same class. I'm not saying we need to create hooks to Model object. Just that we could add it's stan code (maybe also include files, if they are txt), which enables one to wrap Fit object so user can recreate the model used to sample its data. Also stan code is currently only way to parse dtypes for models, but I hope Stan3 fix this problem. |
Could we perhaps address this after the final 3.0 version? We don't even
have a way of serializing fits yet (from the pystan side).
Also, I'm willing to change my opinion if there's an example or two of
people saving fits and forgetting the model from which it came.
In general, I'm genuinely worried about avoiding cruft
<https://martinfowler.com/articles/is-quality-worth-cost.html> and
keeping things as simple as possible because we have limited developer
time. PyStan 2 is so messy (esp the C++ stuff) that it's virtually
impossible to understand, hence costly to maintain.
…On 6/3/19 10:59 AM, Ari Hartikainen wrote:
1.
True that it violates DRY. But Model and Fit are separate objects.
Users will still save only Fit, change models, forget models (reload
Fit after many years; share Fit to coworker; make mistakes). Also
Stan-code is small in size, doesn't lose its descriptiveness,
"universal" being str.
2.
Sure we could make them to save together, but then what would be the
point of having external Fit object.
Scikit-learn keeps model and fit in same class. I'm not saying we need
to create hooks to Model object. Just that we could add it's stan code
(maybe also include files, if they are txt), which enables one to wrap
Fit object so user can recreate the model used to sample its data.
Also stan code is currently only way to parse dtypes for models, but I
hope Stan3 fix this problem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#75>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJQUBVRCYUTDSVATRE3TXBTPYUWU3ANCNFSM4HSCCQIA>.
|
Yes, this can be addressed after Stan3 lands. I think my logic is that, given The current Stan2 fit... is a beast :) (was trying to add some minimal changes to VI to get log_p and log_g, but I guess the reader needs rewrite). |
I definitely think it is a bug that there's no way right now to match Fit instance to Model instance. We definitely need to add There are so many ways to do this particular API. I'm not confident that this way is any better than, say, the way sklearn does it. All I know is that it is essentially what we settled on many years ago here: https://github.com/stan-dev/stan/wiki/User-Interface-Guidelines-for-Developers Let's definitely revisit this in the future. |
Is there any mechanism for this in RStan or CmdStan? cc. @bgoodri @seantalts |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi,
could we add
model.program_code
maybe other information too, so one can infer the model and recreate the model without model instance.They could to dict under
fit.model_info
?The text was updated successfully, but these errors were encountered: