class_docstr: Abstract base class for implementing different cluster centroid initialisation algorithms.
  
  Must be initialised with a reference to the
  weights and implement the single method below.
  
  Optionally, zero-centroid initialization (used for sparsity-aware clustering)
  can be enforced by setting the preserve_sparsity option in the clustering
  parameters.
  The procedure is the following:
  1. First, one centroid is set to zero explicitly
  2. The zero-point centroid divides the weights into two intervals: positive
  and negative.
  3. The remaining centroids are proportionally allocated to the two intervals
  4. For each interval (positive and negative), the standard initialization is
  used.
class_docstr_tok: ["Abstract","base","class","for","implementing","different","cluster","centroid","initialisation","algorithms",".","Must","be","initialised","with","a","reference","to","the","weights","and","implement","the","single","method","below",".","Optionally",",","zero-centroid","initialization","(","used","for","sparsity-aware","clustering",")","can","be","enforced","by","setting","the","preserve_sparsity","option","in","the","clustering","parameters",".","The","procedure","is","the","following",":","1",".","First",",","one","centroid","is","set","to","zero","explicitly","2",".","The","zero-point","centroid","divides","the","weights","into","two","intervals",":","positive","and","negative",".","3",".","The","remaining","centroids","are","proportionally","allocated","to","the","two","intervals","4",".","For","each","interval","(","positive","and","negative",")",",","the","standard","initialization","is","used","."]
docstr: Implements per channel clustering.
docstr_tok: ["Implements","per","channel","clustering","."]
code: def _per_channel_clustering(self):
      """Implements per channel clustering."""
  
      channel_centroids = []
      for channel in range(self.num_channels):
          channel_weights = (
              self.weights[:, channel, :, :]
              if self.data_format == "channels_first"
              else self.weights[:, :, :, channel]
          )
          channel_centroids.append(
              self._calculate_centroids_for_interval(
                  channel_weights, self.number_of_clusters
              )
          )
  
      cluster_centroids = tf.convert_to_tensor(channel_centroids)
  
      return cluster_centroids
  
imports: import abc
  import six
  import tensorflow
  from tensorflow.python.ops import clustering_ops
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
label_desc: Use image node_id 4 for calling the AbstractCentroidsInitialisation obj's underlying member method code with example usage: obj._per_channel_clustering() and returns: cluster_centroids