Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
._LICENSE.txt
._README.md
._bhtsne.py
._fast_tsne.m
._sptree.cpp
._sptree.h
._tsne.cpp
._tsne.h
._vptree.h
LICENSE.txt
README.md
bh_tsne
bh_tsne.tar.gz
bhtsne.py
data-fall-backward.txt
data-fall-forward.txt
data-fall-left.txt
data-fall-right.txt
data-marching.txt
data-rotate-ccw.txt
data-rotate-cw.txt
data-seat-from-stand.txt
data-walk-backward.txt
data-walk-forward.txt
data-walk-left.txt
data-walk-right.txt
event_data.data-fall-backward.txt
event_data.data-fall-forward.txt
event_data.data-fall-left.txt
event_data.data-fall-right.txt
event_data.data-marching.txt
event_data.data-rotate-ccw.txt
event_data.data-rotate-cw.txt
event_data.data-walk-backward.txt
event_data.data-walk-forward.txt
event_data.data-walk-left.txt
event_data.data-walk-right.txt
fast_tsne.m
main_clustering.m
sptree.cpp
sptree.h
tmp.txt
tsne.cpp
tsne.h
vptree.h

README.md

This software package contains a Barnes-Hut implementation of the t-SNE algorithm. The implementation is described in this paper.

Installation

Compile the source using the following command:

g++ sptree.cpp tsne.cpp -o bh_tsne -O2

That's all!

Usage

The code comes with wrappers for Matlab and Python. These wrappers write your data to a file called data.dat, run the bh_tsne binary, and read the result file result.dat that the binary produces. There are also external wrappers available for Torch and R. Writing your own wrapper should be straightforward; please refer to one of the existing wrappers for the format of the data and result files.

Demonstration of usage in Matlab:

filename = websave('mnist_train.mat', 'https://github.com/awni/cs224n-pa4/blob/master/Simple_tSNE/mnist_train.mat?raw=true');
load(filename);
numDims = 2; pcaDims = 50; perplexity = 50; theta = .5;
map = fast_tsne(digits', numDims, pcaDims, perplexity, theta);
gscatter(map(:,1), map(:,2), labels');
You can’t perform that action at this time.