bvanaken/visbert

How to see T-SNE?

Closed this issue · 3 comments

First of all great demo!
Is it possible to have a T-SNE plot instead of a PCA plot?
Also, do you have the ('squad.bin', 'hotpot_distract.bin', and 'babi.bin') models available?

Hi, thanks for your interest in our demo.

In order to switch to T-SNE, you can simply change the reduction method in app.py, line 86, to:
# dimensionality reduction
layer_reduced = visualize.reduce(token_vectors, "tsne", 2)

However, we saw that T-SNE does not create meaningful clusters when only fitted on the data of one sample, but PCA does. So in order to get good T-SNE clusters you must probably fit an estimator on a set of samples, e.g. your training data and then apply it to new unseen samples. The estimator could then be loaded and applied in visualize.py.

Regarding your question about the models, we decided to provide the models for download here: https://drive.google.com/drive/folders/1RZvlZmhxiJKiAagwvE5vjmevmiqqjR0r

Thanks a lot!