facebookresearch/swav

Deepclusterv2:How to dispaly the results?

Youngboy12 opened this issue · 1 comments

I have used main_deepclusterv2.py train a model on my custom dataset, I want to see the results of cluster. For example, put the images in same class into the same folder. How to do that? Thank you.

Hi @Youngboy12

For example you could dump the assignments tensor.

assignments = cluster_memory(model, local_memory_index, local_memory_embeddings, len(loader.dataset))
It is a tensor of size "number of clusterings" x "size of the dataset" where assignments[i][j] is an int that corresponds to the cluster id assigned to instance j based on the ith clustering.

With this assignment tensor you can easily find all instances belonging to a same cluster.