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","."]
code: def __init__(
      self,
      weights,
      number_of_clusters,
      cluster_per_channel=False,
      data_format="channels_last",
      preserve_sparsity=False,
  ):
      # Input checks
      if (
          data_format != "channels_first"
          and data_format != "channels_last"
      ):
          raise ValueError(
              "The given parameter data_format is not correct: {input}".format(
                  input=data_format
              )
          )
  
      self.weights = weights
      self.number_of_clusters = number_of_clusters
      self.cluster_per_channel = cluster_per_channel
      self.data_format = data_format
      self.preserve_sparsity = preserve_sparsity
  
      if cluster_per_channel:
          self.num_channels = (
              weights.shape[1]
              if self.data_format == "channels_first"
              else weights.shape[-1]
          )
  
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 1 to create a new AbstractCentroidsInitialisation object  with example: obj = AbstractCentroidsInitialisation(weights, number_of_clusters, cluster_per_channel, data_format, preserve_sparsity)