#include <lsh.h>
Public Types | |
typedef const float * | Domain |
Public Member Functions | |
template<typename RNG> | |
void | reset (const Parameter ¶m, RNG &rng) |
template<typename RNG> | |
HyperPlaneLsh (const Parameter ¶m, RNG &rng) | |
unsigned | getRange () const |
unsigned | operator() (Domain obj) const |
unsigned | operator() (Domain obj, float *delta) const |
template<class Archive> | |
void | serialize (Archive &ar, const unsigned int version) |
Classes | |
struct | Parameter |
Random hyperplane based LSH can be used to approximate cosine similarity. This LSH is defined on the D-dimensional vector space. For a vector X, the hash value is defined as
where <a1,...,aD> is a random vector sampled from the unit hypersphere.
The domain of the LSH is (const float *), and the parameter is defined as
struct Parameter { unsigned dim; };
For more information on stable distribution based LSH, see the following reference.
Charikar, M. S. 2002. Similarity estimation techniques from rounding algorithms. In Proceedings of the Thiry-Fourth Annual ACM Symposium on theory of Computing (Montreal, Quebec, Canada, May 19 - 21, 2002). STOC '02. ACM, New York, NY, 380-388. DOI= http://doi.acm.org/10.1145/509907.509965