Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change the metric let say mahalanobis metric or precomputed one? #8

Closed
arm2arm opened this issue Aug 10, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@arm2arm
Copy link

arm2arm commented Aug 10, 2018

Is it possible to change the metric let say mahalanobis metric or precomputed one?
thanks,

@DavidMChan
Copy link
Member

Right now, that's not possible. Currently FAISS only supports the L2 and Inner Product (Cosine) metrics - It would be an easy matter however to expose the pre-computed distance matrix - if you were willing to provide a similarity matrix, however this would significantly decrease the performance of the library.

To sum it up, we will be adding the ability to pass in your own distance matrix, and support for the Inner Product metric in an upcoming build (once some of the people behind this get back from vacation), but we have no plans to support metrics which are not up-stream in FAISS.

@DavidMChan DavidMChan added the enhancement New feature or request label Aug 10, 2018
@arm2arm arm2arm closed this as completed Aug 13, 2018
@shrimpceviche
Copy link

Is the ability to pass in one's own distance matrix still on the road map?

@marcociccone
Copy link

Up for the question :-) 👍
I think adding the possibility of using a precomputed distance matrix would be a great addition!

@DavidMChan
Copy link
Member

tsnecuda works by computing approximate nearest neighbors for each of the points in the high dimensional space. It would be easy to add the ability to pass in a sparse nearest neighbors matrix, however it becomes more complicated if you want to extract the nearest neighbors from a pre-computed distance matrix.

The algorithm for nearest neighbors in tsnecuda is built on a combination of multiprobing LSH and product quantization - implemented through the FAISS library for GPU nearest neighbors. This means that we can support at most the set of metrics that FAISS can support, without writing custom code to probe for the NN matrix. The next version of tsnecuda will include the L2 metric, as it has been added upstream.

See facebookresearch/faiss#848 for a discussion on the upstream progress for distance metrics.

@marcociccone
Copy link

Thank you for the clarification!

dogadikbayir pushed a commit to dogadikbayir/tsne-cuda that referenced this issue May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants