[mlpack] [mlpack/mlpack] Implement multidimensional discrete distribution (#830)

Tiramisu 1993 notifications at github.com
Thu Dec 22 10:10:45 EST 2016


MikeLing commented on this pull request.



> @@ -56,26 +56,34 @@ class DiscreteDistribution
    * @param numObservations Number of possible observations this distribution
    *    can have.
    */
-  DiscreteDistribution(const size_t numObservations) :
-      probabilities(arma::ones<arma::vec>(numObservations) / numObservations)
-  { /* nothing to do */ }
+  DiscreteDistribution(const size_t numObservations, const size_t dimension=1):
+          probabilities(dimension, numObservations)
+  {
+    probabilities.ones();

Hi @rcurtin, Could I define and init a matrix like this? Why this failed and I also can't use `probabilities.set_size(dimension, numObservations)`? 

I had google it but it doesn't help. I have no idea how to use `arma:mat `class even after I read some documents about it.

Thank you

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/830#pullrequestreview-14170953
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://knife.lugatgt.org/pipermail/mlpack/attachments/20161222/395a95af/attachment.html>


More information about the mlpack mailing list