Cluster Centroids in Deep Embedding Clustering

Hi, I’m new to MxNet and am trying to use the Deep Embedding Clustering example found here: https://github.com/apache/incubator-mxnet/tree/master/example/deep-embedded-clustering

After training, I wish to get the cluster centroids generated by DEC and feed this into the decoder. How could I go about doing this?

Hi,

The cluster centroids generated by DEC is actually computed by the sklean.cluster.KMeans object used to fit the kmeans model on the embeddings.

It can be obtained by running a forward pass for all of the data on the trained encoder, calling kmeans.fit() on the embeddings for all the training data and calling kmeans.cluster_centers_ to retreive the centroids, which can then be passed into the decoder in order to visualize the centroids in the original data space.

See https://github.com/apache/incubator-mxnet/blob/master/example/deep-embedded-clustering/dec.py#L119-L120 for an example of how kmeans is performed and the centroids are retrieved during training.