t-SNE accelerated with PyTorch
Project description
t-SNE pytorch Implementation with CUDA
CUDA-accelerated PyTorch implementation of the t-stochastic neighbor embedding algorithm described in Visualizing Data using t-SNE.
Installation
Requires Python 3.7
Install via Pip
pip3 install tsne-torch
Install from Source
git clone https://github.com/palle-k/tsne-pytorch.git
cd tsne-pytorch
python3 setup.py install
Usage
from tsne_torch import TorchTSNE as TSNE
X = ... # shape (n_samples, d)
X_emb = TSNE(n_components=2, perplexity=30, n_iter=1000, verbose=True).fit_transform(X) # returns shape (n_samples, 2)
Command-Line Usage
python3 -m tsne_torch --xfile <path> --yfile <path>
Example
This is our result compare to result of python implementation.
- PyTorch result
- python result
Credit
This code highly inspired by
- author's python implementation code here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tsne-torch-1.0.1.tar.gz
(5.3 kB
view hashes)