class_docstr: Sample centroids randomly and uniformly from the interval [min(weights), max(weights)].
class_docstr_tok: ["Sample","centroids","randomly","and","uniformly","from","the","interval","[","min","(","weights",")",",","max","(","weights",")","]","."]
code: def _calculate_centroids_for_interval(
      self, weight_interval, number_of_clusters_for_interval
  ):
      weight_min = tf.reduce_min(weight_interval)
      weight_max = tf.reduce_max(weight_interval)
      cluster_centroids = tf.random.uniform(
          shape=(number_of_clusters_for_interval,),
          minval=weight_min,
          maxval=weight_max,
          dtype=weight_interval.dtype,
      )
      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 1 for calling the RandomCentroidsInitialisation obj's underlying member method code with example usage: obj._calculate_centroids_for_interval(weight_interval, number_of_clusters_for_interval) and returns: cluster_centroids