Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytorch version? #73

Open
antspy opened this issue May 31, 2018 · 4 comments
Open

Pytorch version? #73

antspy opened this issue May 31, 2018 · 4 comments

Comments

@antspy
Copy link

antspy commented May 31, 2018

Hi,

Since t-SNE is increasingly used to visualize neural networks outputs (and their layers), it would be extremely helpful to have an implementation of t-SNE in pytorch, in particular the barnes-hut version that runs in N log N.

Is this something you would be interested in doing?
Thanks!

@lvdmaaten
Copy link
Owner

Given a PyTorch tensor, can't you simply run run_bh_tsne(tensor.numpy(), **kwargs)?

@antspy
Copy link
Author

antspy commented Jun 1, 2018

Thank you for your quick reply! You're right, I was a bit unclear.

The problem with that is that you need to save your whole dataset into memory; I was thinking of a version that uses a data loader instance that returns the batches, and instead of doing gradient descent you do SGD on every batch (and ideally, everything runs on GPU so you don't have to move the tensors back and forth from CPU and GPU).

@lvdmaaten
Copy link
Owner

@antspy I see. That is a non-trivial project for at least two reasons: (1) t-SNE is an non-parametric method, which makes getting SGD to work well less trivial (note an SGD update will only update part of the parameters) and (2) implementing an efficient Barnes-Hut algorithm on GPUs is non-trivial because the algorithm is presumably memory-bound rather than compute-bound. Efficient GPU implementations likely require further approximations; see, for instance, this.

@antspy
Copy link
Author

antspy commented Jun 1, 2018

@lvdmaaten I see. Thank your for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants