Skip to main content

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

pytorch result

  • python result

python result

Credit

This code highly inspired by

  • author's python implementation code here.

Project details


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.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

tsne_torch-1.0.0-py3.8.egg (8.6 kB view details)

Uploaded Source

File details

Details for the file tsne-torch-1.0.0.tar.gz.

File metadata

  • Download URL: tsne-torch-1.0.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

File hashes

Hashes for tsne-torch-1.0.0.tar.gz
Algorithm Hash digest
SHA256 31f6d56475e73c0d990c412ef11f9833b6840812aaa93994b2d565248d9b9f62
MD5 3e9f74bcfa6113161d871f545f776957
BLAKE2b-256 810fce6e9597aa0eb0b60fd627a43aecdcde264d0d85e8c86d9758335385012d

See more details on using hashes here.

Provenance

File details

Details for the file tsne_torch-1.0.0-py3.8.egg.

File metadata

  • Download URL: tsne_torch-1.0.0-py3.8.egg
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

File hashes

Hashes for tsne_torch-1.0.0-py3.8.egg
Algorithm Hash digest
SHA256 c05dd82ce9e623ba5604bd6b5f824032f53212ec8b241cc678f7c46d7cf56d26
MD5 0f4211ee60877194c31550e7e0f8a2ae
BLAKE2b-256 874836adcb38fe1f94f90a5a6807152366ce84bffca5a7c41bb0258a4df10f3f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page