title: Is there a way to apply K-Means to the output of Conv/Dense layers in tensorflow?
body: <p>I have trained a CNN on Fashion MNIST data with the following configuration:
  Conv-Pool-Dropout-Conv-Pool-Dropout-Flat-Dense-Dropout-Output
  I would like to change the configuration to: 
  Conv-Clustering-Pool-Dropout-Conv-Clustering-Pool-Dropout-Flat-Dense-Clustering-Dropout-Output
  However, I want this new configuration only for testing and not training the model (I can use the weights from the trained model and set them for the model with Clustering configuration). Is there a way to add the Clustering layer using tensorflow? 
  I would like to represent the output of the Conv and Dense layers using the cluster centroids to examine the effects on the accuracy of the model. </p>