[mlpack-git] master: I'm not sure what line width Pari used, but it wasn't 80 columns. (e6d2ca7)
gitdub at mlpack.org
gitdub at mlpack.org
Tue May 31 16:56:11 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/02e31b3b07f1c4ea5abf067c029cd3ea69a5c8ae...e6d2ca7bf64b47a36ac489335cf0dd8933e13076
>---------------------------------------------------------------
commit e6d2ca7bf64b47a36ac489335cf0dd8933e13076
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue May 31 16:56:11 2016 -0400
I'm not sure what line width Pari used, but it wasn't 80 columns.
This will probably make the merge of #663 and other LSH improvements by Yannis
harder...
>---------------------------------------------------------------
e6d2ca7bf64b47a36ac489335cf0dd8933e13076
src/mlpack/methods/lsh/lsh_search_impl.hpp | 34 +++++++++++++++---------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/mlpack/methods/lsh/lsh_search_impl.hpp b/src/mlpack/methods/lsh/lsh_search_impl.hpp
index b956ed2..02d0021 100644
--- a/src/mlpack/methods/lsh/lsh_search_impl.hpp
+++ b/src/mlpack/methods/lsh/lsh_search_impl.hpp
@@ -358,19 +358,19 @@ template<typename SortPolicy>
void LSHSearch<SortPolicy>::BuildHash()
{
// The first level hash for a single table outputs a 'numProj'-dimensional
- // integer key for each point in the set -- (key, pointID)
- // The key creation details are presented below
+ // integer key for each point in the set -- (key, pointID). The key creation
+ // details are presented below.
//
- // The second level hash is performed by hashing the key to
- // an integer in the range [0, 'secondHashSize').
+ // The second level hash is performed by hashing the key to an integer in the
+ // range [0, 'secondHashSize').
//
- // This is done by creating a weight vector 'secondHashWeights' of
- // length 'numProj' with each entry an integer randomly chosen
- // between [0, 'secondHashSize').
+ // This is done by creating a weight vector 'secondHashWeights' of length
+ // 'numProj' with each entry an integer randomly chosen between [0,
+ // 'secondHashSize').
//
- // Then the bucket for any key and its corresponding point is
- // given by <key, 'secondHashWeights'> % 'secondHashSize'
- // and the corresponding point ID is put into that bucket.
+ // Then the bucket for any key and its corresponding point is given by <key,
+ // 'secondHashWeights'> % 'secondHashSize' and the corresponding point ID is
+ // put into that bucket.
// Step I: Prepare the second level hash.
@@ -379,9 +379,9 @@ void LSHSearch<SortPolicy>::BuildHash()
(double) secondHashSize);
// The 'secondHashTable' is initially an empty matrix of size
- // ('secondHashSize' x 'bucketSize'). But by only filling the buckets
- // as points land in them allows us to shrink the size of the
- // 'secondHashTable' at the end of the hashing.
+ // ('secondHashSize' x 'bucketSize'). But by only filling the buckets as
+ // points land in them allows us to shrink the size of the 'secondHashTable'
+ // at the end of the hashing.
// Fill the second hash table n = referenceSet.n_cols. This is because no
// point has index 'n' so the presence of this in the bucket denotes that
@@ -404,8 +404,8 @@ void LSHSearch<SortPolicy>::BuildHash()
size_t numRowsInTable = 0;
// Step II: The offsets for all projections in all tables.
- // Since the 'offsets' are in [0, hashWidth], we obtain the 'offsets'
- // as randu(numProj, numTables) * hashWidth.
+ // Since the 'offsets' are in [0, hashWidth], we obtain the 'offsets' as
+ // randu(numProj, numTables) * hashWidth.
offsets.randu(numProj, numTables);
offsets *= hashWidth;
@@ -416,8 +416,8 @@ void LSHSearch<SortPolicy>::BuildHash()
{
// Step IV: Obtain the 'numProj' projections for each table.
- // For L2 metric, 2-stable distributions are used, and
- // the normal Z ~ N(0, 1) is a 2-stable distribution.
+ // For L2 metric, 2-stable distributions are used, and the normal Z ~ N(0,
+ // 1) is a 2-stable distribution.
arma::mat projMat;
projMat.randn(referenceSet->n_rows, numProj);
More information about the mlpack-git
mailing list