-
Notifications
You must be signed in to change notification settings - Fork 219
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
API design for non-Turing samplers #886
Comments
I think the following additional functions could be a good start. (I think that the assume and observe statements should be kept.) Please correct me if I’m wrong or if I’m missing something.
In addition it would be good in my opinion to have a way to track the results ( For this purpose I would add the following macros.
Those macros can be used by the user in the model block to track expressions or by the developer of inference algos. |
Are we assuming for this conversation that people are building a new If the goal is just to look at new inference functions, we can streamline what we have pretty well. By default #793 will add a Some general functions that would work using the enforced
One thing that we might look at is how close we can make the code in Turing to the pseudo-code you might see in an algorithm block in a new paper. Turing's pretty good on the model side, but the pseudo-code side is not quite as intuitive. I think the functions mentioned by @trappmartin would go a long way towards making everything generally accessible. |
I like we can make this in several iterations and get rid of the I'm not sure about the MH-like functions. But I might miss something. Maybe instead we could have simple access to internal samplers (MH, IS) and sample a value using I think we should also think about the interface functions we would need for VI. @torfjelde what do you think? |
Sorry, I completely missed this mention; didn't see it until yesterday. Also not sure if this discussion is still ongoing? Anyways, for VI in particular the Also a way of tracking the logpdf for each Worth noting that for using Similarly, the The |
Yeas, you are right. Things like |
Another bit of low-hanging fruit is to make a function |
In reference to this comment:
I wonder if we should spin off an "AdvancedMH" package to show people how you might build a Turing-interfaced library. |
Sounds good to me, but maybe we can do the implementation in the Turing repo first? This avoids the pain of keeping two packages synced. |
I'm going through some of these suggestions while I'm updating the MH code, and I'm wondering if we can just give everyone default Specifically, I'd like to do two things:
The reason I want a generically useful Additionally, most inference algorithms are already implementing the most basic possible Thoughts on that? |
Woops, didn't mean to close that. Sorry. |
What about having an abstract type Maybe it is better to make an extra PR for this? |
Probably. I think we basically just need to implement the I have a prototype function with the signature |
I should clarify that my proposal has little to do with dispatch on a sampler type -- it should default to basically the following, regardless of sampler type: function assume(. . . )
return vi[vn], logpdf(dist, vi[vn])
end This is just something helpful for foreign developers. If they want to manually modify the contents of the |
Having this default |
Closed in favour of #1735 |
One important design goal of Turing is to making implementing new sampling algorithms easier. There is already an ongoing effort for decoupling modelling and inference algorithms (see. e.g. #793, #746, #750). For the next steps, it would be helpful to
More
Related: #895 #889
The text was updated successfully, but these errors were encountered: