-
Notifications
You must be signed in to change notification settings - Fork 539
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
UMAP & T-SNE to pass user-configured metrics to KNN #1653
Comments
Hi @Yerne. We do have plans to implement this functionality, though it's not on the planned roadmap yet and we don't have a planned time frame. That being said, we are currently using FAISS for fast KNN and they are going to be integrate these distances very soon. Once they have those exposed, the change should be accomplished fairly easily on our end. Here's the FAISS issue for reference: facebookresearch/faiss#848 |
Our KNN now supports additional distance metrics but now these need to be wired up in both UMAP and T-SNE. Changing the title to do this. |
@cjnolet Hi! Just curious. Are you going to implement this feature on 0.18 Release? |
Same question here! When can this function be released since it's crucial for word2vec viz using cosine distance. @cjnolet |
Our UMAP API does accept a from cuml.neighbors import NearestNeighbors
from cuml.manifold import UMAP
import numpy as np
a = np.random.random((100, 10))
m = NearestNeighbors(n_neighbors=10, metric='cosine')
m.fit(a)
knn_graph = m.kneighbors_graph(a, mode='distance')
u = UMAP(n_components=2)
u.fit_transform(a, knn_graph=knn_graph) |
@cjnolet this is great. thanks! |
@cjnolet , Yes it does work. Thank you for the quick response. |
Is it possible to use such a temporary hack with TSNE ? or even with KMEANS ? |
@gandroz, unfortunatley k-means is limited to L2/Euclidean, though I suppose you could L2 normalize your vectors in order to achieve something close to a spherical k-means w/ the angular distance. The |
- [x] TSNE allow different distance metrics to be passed to KNN - [x] TSNE distance metric pytests - [x] UMAP allow different distance metrics to be passed to KNN - [x] UMAP distance metric pytests closes #1653 Authors: - Tarang Jain (https://github.com/tarang-jain) - Corey J. Nolet (https://github.com/cjnolet) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: #4779
- [x] TSNE allow different distance metrics to be passed to KNN - [x] TSNE distance metric pytests - [x] UMAP allow different distance metrics to be passed to KNN - [x] UMAP distance metric pytests closes rapidsai#1653 Authors: - Tarang Jain (https://github.com/tarang-jain) - Corey J. Nolet (https://github.com/cjnolet) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: rapidsai#4779
my question, is there any implementation planning for metrics feature like in classic UMAP learn package?
like that:
"The metric to use to compute distances in high dimensional space. If a string is passed it must match a valid predefined metric. If a general metric is required a function that takes two 1d arrays and returns a float can be provided. For performance purposes it is required that this be a numba jit’d function. Valid string metrics include:
The text was updated successfully, but these errors were encountered: