Contrastive-Clustering
Contrastive-Clustering copied to clipboard
t-SNE plotting utils
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!
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.
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
?
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.