Skip to content

Instantly share code, notes, and snippets.

@danielhanchen
Created November 22, 2019 16:11
Show Gist options
  • Select an option

  • Save danielhanchen/6365099838a055ed2299f10ab86b78ba to your computer and use it in GitHub Desktop.

Select an option

Save danielhanchen/6365099838a055ed2299f10ab86b78ba to your computer and use it in GitHub Desktop.
RAPIDS cuML TSNE
from sklearn.datasets import load_digits
X, y = load_digits().data, load_digits().target
from cuml.manifold import TSNE
tsne = TSNE(n_components = 2)
X_hat = tsne.fit_transform(X)
# To plot the embedding
import matplotlib.pyplot as plt
%matplotlib inline
plt.scatter(X_hat[:,0], X_hat[:,1], c = y, s = 0.5)
@ucalyptus
Copy link

Hi , can you show an example for Hyperspectral images?

data.shape is 145,145,200
targets.shape is 145,145

@danielhanchen
Copy link
Author

@ucalyptus There are more examples in the blog: https://medium.com/rapids-ai/tsne-with-gpus-hours-to-seconds-9d9c17c941db [MNIST, Fashion MNIST etc]. https://github.com/rapidsai/cuml is probably the best place for you to ask about extremely large visualization requests! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment