-
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
Printing or saving posterior distribution parameters, not density function #10
Comments
Hi Gwonsoo, The main challenges are:
What is your use case? Is it just for readability? Best, |
Only doing so for cases where we can figure out the type (e.g., normal) of distributions easily would still be useful. Readability is one, but not just that. One may directly compare the distribution computed by PSI with the one produced by a different learning/inference algorithm. For example, one basic form of the variational distribution (in variational inference) is a mean-field normal, and one may want to compare (and possibly plot together) what's learned with what PSI produces. My use case is similar to this. Another use case is that one may want to use the distribution parameters as the input to another machine learning algorithm or system. That way, the algorithm may exploit the power of PSI and focus on something that the algorithm should do. The density output format may be useful for some other use cases, but for simpler cases (e.g., normal), providing mean and standard deviation seems more concise and useful (since the mean and standard deviation characterizes the normal distribution, and it's easy to set up the density function with the two quantity). Thanks, |
If PSI gives you a Gaussian PDF with concrete parameters for some variable, I think it will reliably simplify queries of the following form:
So possibly this can help you out while you wait for further built-in support. |
Thank you very much, Timon. It is a nice and simple way of getting those quantities. But there is another concern. What PSI returns includes symbols as in |
It seems like the What I want to do specifically is to print the variable |
Hi Gwonsoo, just put the following after line 146: DExpr toFloat(DExpr e){
auto h=e.getHoles!(x=>cast(Dℚ)x,Dℚ);
auto r=h.expr;
foreach(hole;h.holes){
r=r.substitute(hole.var,dFloat(toReal(hole.expr.c)));
}
return r.simplify(one);
}
expectation=toFloat(expectation); Maybe we can add something like this as a more general command-line option at some point. (Note: With the workaround above, the result is subject to round-off error, therefore sometimes not all printed significant digits are correct.) |
Great workaround, and it works! Thank you so much for the workaround and the caution. Thanks, |
Dear PSI team,
Thanks for the nice solver and clean documentation.
It would be very useful if we can specify an option so that the solver produces parameters of the posterior distribution as well as the density function. For example, when the posterior distribution is a normal, then it would be more useful if we could just get the mean and standard deviation (possibly in the csv form).
I read the github page and the CAV 2016 paper, but I couldn't figure out how to do it. So now I think that the current solver does not have the functionality.
Do you also think it is a good thing to do?
Thanks,
Gwonsoo
The text was updated successfully, but these errors were encountered: