-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
[Stan 2.33] Pathfinder algorithm #684
Comments
It's a bit unfortunate that laplace has argument |
I would suggest just |
sampling uses “iter_sampling”, which is the worst of the bunch I think |
Yeah, I think we should consider picking one name for the number of draws and deprecating all the other ones. |
the problem with the question is do we want argument names to be semantically correct? |
how about draws to refer to the posterior (the "real" thing people want) and warmup_draws for the warmup phase... which is something people have to do to get to what they want... |
Pathfinder has for CmdStanR and CmdStanPy I agree that we should wrap Pathfinder and not expose w/r/t unfortunateness of |
What should the |
in the case where num_paths=1, it corresponds to the |
I like |
I guess my question is if it ever makes sense to request a different number of single-pathfinder draws even when the thing you really care about is the PSIS draws. What if num_psis_draws > num_draws * num_paths? |
How does the CmdStan implementation handle that? |
It doesn’t do any checks, so I suppose the question falls to the services implementation by @SteveBronder my guess is you probably end up with repeated draws in the PSIS output? |
I think we can do something like
when num_paths == 1, these are synonyms and it is an error to set both of them (to different values) |
I like the there has been a long discussion on Stan developer slack about whether or not Pathfinder can also provide inits for the metric and stepsize. cf: https://mc-stan.slack.com/archives/C7V03NJHL/p1692880182694339 |
I think this will eventually be important, but I don't want to think about the API/implementation of this until more people have had the ability to play around |
I just put a comment in the CmdStanR Pathfinder discussion: stan-dev/cmdstanr#840 (comment) |
Thanks! |
I would like to have an option |
I think we'd need to add this option to the stan::services::pathfinder method, no? |
Yes, it needs to be first added to Stan services. There's an open issue for that stan-dev/stan#3215 |
@avehtari just so I understand, don't we need the lp evaluations to then do PSIS? If yes then would that mean we turn off psis when |
Correct |
when |
It makes more sense for single path, but with multi path it can still be used to figure out if there are well-separated modes (but lp is needed to see if some of them are minor modes) |
if |
You have great questions! chain id would help to diagnose well separated modes, but if that is difficult to add then just returning the number of draws we would return with lp true would be fine. |
When we have multi-path, we're always generating those log densities. It's an independent question of whether to include them in the output. |
Summary:
Expose Pathfinder: stan-dev/stan#3123 stan-dev/cmdstan#1155
This issue is to sketch out a design and for coordinating with the CmdStanR team (@jgabry)
Description:
Pathfinder is useful for standalone VI and for initializing MCMC, so we should cater to both usages.
New method on
CmdStanModel
:pathfinder
.Signature:
This is probably more-or-less what you would expect going off of the CmdStan implementation. One notable thing is - at the moment - I am not providing a way to save individual pathfinder runs (the
save_single_paths
arg). If things from the diagnostic files produced by this argument end up being important to initializing MCMC, we can add support then, but I don't think it is valuable in the first implementationNew Class
CmdStanPathfinder
This will look broadly similar to CmdStanLaplace, with the main methods being those that let you access the draws:
stan_variable
,draws_pd
, etcFor supporting the initialization of MCMC, I think it is important to also have a method like
create_inits(self, seed = None, num_chains = 4)
This will return a list of dictionaries of 4 random draws from the pathfinder outputs in the format required for the inits argument to other methods. We can also consider adding
CmdStanPathfinder
as an option for theinits
argument directly, in which case this method would just be called.The text was updated successfully, but these errors were encountered: