[mlpack-git] [mlpack/mlpack] Lsh table access (#663)
Ryan Curtin
notifications at github.com
Tue May 31 16:51:26 EDT 2016
> + // Z ~ N(0, 1) is p-stable.
> + projMat.randn(referenceSet->n_rows, numProj);
> + }
> + else //user-specified projection tables
> + {
> + projMat = projection[i];
> +
> + //make sure specified matrix is of correct size
> + if ( projMat.n_rows != referenceSet->n_rows )
> + throw std::invalid_argument(
> + "projection table dimensionality doesn't"
> + " equal dataset dimensionality" );
> + if ( projMat.n_cols != numProj )
> + throw std::invalid_argument(
> + "projection table doesn't have correct number of projections");
> + }
We might be able to clean this up a bit: instead of calling `projMat.randn()`, if we use a `cube` instead, we can just call `cube::randn(referenceSet->n_rows, numProj, numTables)` once at the beginning of the function, and move this entire conditional there. Then `projMat` or `projections[i]` won't need to be touched at all here.
---
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/663/files/934fe082230f7d8b8f9c3e9c1fe2f9fc25ea493e#r65260249
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160531/6f872cfc/attachment.html>
More information about the mlpack-git
mailing list