-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Using C++11s Distributions in Shogun #1998
Comments
I agree, we should try to use as much C++11 as possible. This is well-tested and reliable code and we don't even add a new dependency. So we can do most of the sampling using c++11 methods. For some multivariate distributions, we will need some amount of linear algebra operations. Those should be done against our Shogun internal (soon to exist) framework, see #1930 and #1973. Or, since the latter interface is not yet complete, use eigen3 (such as the multivariate Gaussian). In additions, and maybe more important than sampling, is to be able to evaluate the pdf/cdf of those densities. AFAIK this is not supported by c++11. Also, one can do lots of things ineffective or even wrong. An example is again the Gaussian, the Cholesky decomposition of the covariance should only be computed once in the beginning (if not already specified) such that evaluating the pdf of samples does not have to do that again. For many distributions, evaluating the pdf of many points at once comes at the same cost as evaluating a single points (see again Gaussian). Another interesting feature would be to compute quantiles of a given number of points (see https://github.com/karlnapf/kameleon-mcmc) Stan can serve as a
|
Final point: We want a unified interface in Shogun, so merge all the existing probability classes into one
|
regarding SFMT: no... we've just added SFMT. before even suggesting something like that, it'd be better to investigate the performance between SFMT/dSFMT and c++11 |
yeah very good point! In fact, let's just stay with the current one and only add things from c++11 if we there is not existing implementation. This is not really about re-doing normal numbers but about interfaces of probability distributions |
yeah we had a discussion about this with @cameo54321 on IRC. i've tried to suggest that it would be good to check out other libraries (e.g. |
Yeah, so just to summarise a few things
Please see the kameleon-mcmc distribution framework on my github. This is in the direction of what we want. |
feature/refactor-random is on this path :) |
FYI: ALGLIB did already got pushed out a while ago (it was GPL code, replace with cdflib) |
The recent addition in shogun for a probability distribution was:
http://www.shogun-toolbox.org/doc/en/3.0.0/classshogun_1_1CProbabilityDistribution.html
with implementation
http://www.shogun-toolbox.org/doc/en/3.0.0/classshogun_1_1CGaussianDistribution.html
The above implementation uses SIMD-oriented Fast Mersenne Twister (SFMT) pseudorandom number generator for random number generation and Eigen3 for generating the Gaussian Distribution from these samples.
The C++11s Pseudo-random number generator (as pointed by @vigsterkr) has many built-in distributions and random number generators which can be used for generating distributions in Shogun. So instead of implementing each distribution by ourselves, can we use C++11s distributions?
What if the classes for the Issue #1929 are written utilizing C++11s distributions in mind instead of (or alongwith) SFMT? What can be a good direction to achieve that?
@karlnapf @vigsterkr Comments please?
The text was updated successfully, but these errors were encountered: