Contrastive-Clustering icon indicating copy to clipboard operation
Contrastive-Clustering copied to clipboard

t-SNE plotting utils

Open sramakrishnan247 opened this issue 3 years ago • 3 comments

Hey,

Thanks for sharing the code and writing such a good paper! Can you give me some more info on how I can use your code to generate the t-SNE plots? I do not see any plot utilities in the code that you have shared. Thanks!

sramakrishnan247 avatar Jun 28 '21 21:06 sramakrishnan247

Thanks. I recommend generating the t-SNE plot with the matplotlib package (see details in https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html). And the t-SNE result could be obtained by the sklearn package (see details in https://scikit-learn.org/stable/modules/generated/sklearn.manifold.TSNE.html). In our work, the input of t-SNE is the embedding learned by our ICH.

Yunfan-Li avatar Jun 29 '21 01:06 Yunfan-Li

Just a further clarification,

Does this give the correct output https://github.com/Yunfan-Li/Contrastive-Clustering/blob/a18466c321aa8e7b75418afd7e7f72ff30f2c18f/modules/network.py#L36

Or do I need to take the output of instance_projector?

sramakrishnan247 avatar Jul 07 '21 17:07 sramakrishnan247

The "forward_cluster" gives the cluster assignments. I recommend using the output features of the "instance_projector" as the inputs of t-SNE, since they contain more information than cluster assignments.

Yunfan-Li avatar Jul 08 '21 06:07 Yunfan-Li