[Media] Barnes-Hut t-SNE localized entirely within your browser

61 points Personal_Juice_2941 7 comments
[Media] Barnes-Hut t-SNE localized entirely within your browser

I believe that t-SNE is a marvelous tool for data exploration, and that everybody should get to use it. Unfortunately, it is also surprisingly complex to install in several implementations (various c/c++ dependencies of the Python versions, or CUDA), and where it is not difficult to get running, it is slow (sklearn's for instance). I got fed up with it.

Therefore, I started a crusade to make github.com/frjnn/bhtsne much faster, and I am happy to claim it is now indicatively x20 times faster than before, plus it now compiles to WASM. Now, browser support multi-threading, and thanks to https://github.com/RReverser/wasm-bindgen-rayon you can immediately and trivial use rayon pools there.

Result is an open-sourced dioxus web app where you can drop your dataset, and see a light spectacle as your t-SNE is computed. You even get to save it as a short webm video.

Of course, for very large datasets in the millions range you would want to run it natively using bhtsne, but it does cover quite some range. The image for instance is in real time and is visualizing 70K points from MNIST, after a strong preliminary PCA reduction to 20 dimensions.

As I have now added support for custom indices in bhtsne, in the next weeks, I will also add ANN LSH indices for various data types such as molecules and MS/MS spectra.

Try the webapp: tsne.luca.phd/
Find the code on GitHub: https://github.com/LucaCappelletti94/dioxus-tsne