[mlpack-git] [mlpack] add a wrapper for the matrix completion SDP (#374)

Stephen Tu notifications at github.com
Fri Jan 9 17:02:38 EST 2015


> +                                     const size_t n,
> +                                     const size_t p)
> +{
> +  const size_t mpn = m + n;
> +  float r = 0.5 + sqrt(0.25 + 2 * p);
> +  if (ceil(r) > mpn)
> +    r = mpn; // An upper bound on the dimension.
> +  return ceil(r);
> +}
> +
> +arma::mat MatrixCompletion::CreateInitialPoint(const size_t m,
> +                                               const size_t n,
> +                                               const size_t r)
> +{
> +  const size_t mpn = m + n;
> +  return arma::randu<arma::mat>(mpn, r);

Ok on inlining the call to `randu`. However, I don't see the benefit of templatizing the initialization strategy, when we have a constructor which takes in an initial point. I don't have a whole list of initialization strategies that I would think are significantly better than random. It might be a stylistic thing, but my initial reaction when coding C++ is to avoid throwing templates at the problem unless there is a clear benefit :)

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/374/files#r22746527
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150109/79a145db/attachment-0001.html>


More information about the mlpack-git mailing list