Skip to contents

Transforms vectors such that the max. inner product (MIP) search is equal to a NN search with euclidean distances.

Usage

augment_vector(vectors)

Arguments

vectors

Matrix of row vectors

Value

A new matrix of row vectors with one additional (first) dimension that is the square root of the difference between the squared max. vector norm and the squared vector norm. This makes the norm of all vectors effectively the same.

Details

See also: https://github.com/benfred/implicit/blob/42832574f1a29c71b3263e219fc471fc97328552/implicit/utils.py#L60 https://towardsdatascience.com/maximum-inner-product-search-using-nearest-neighbor-search-algorithms-c125d24777ef

References

Yoram Bachrach, Yehuda Finkelstein, Ran Gilad-Bachrach, Liran Katzir, Noam Koenigstein, Nir Nice, Ulrich Paquet. Speeding up the Xbox recommender system using a euclidean transformation for inner-product spaces. RecSys 2014