class_docstr: Factory that creates concrete initializers for factory centroids.
  
  To implement a custom one, inherit from AbstractCentroidsInitialisation
  and implement all the required methods.
  
  After this, update CentroidsInitialiserFactory.__initialisers hashtable to
  reflect new methods available.
class_docstr_tok: ["Factory","that","creates","concrete","initializers","for","factory","centroids",".","To","implement","a","custom","one",",","inherit","from","AbstractCentroidsInitialisation","and","implement","all","the","required","methods",".","After","this",",","update","CentroidsInitialiserFactory.__initialisers","hashtable","to","reflect","new","methods","available","."]
docstr: Gets centroid initializer.
  
  Args:
    init_method: a CentroidInitialization value representing the init
    method requested
  Returns:
    A concrete implementation of AbstractCentroidsInitialisation
  Raises:
    ValueError if the requested centroid initialization method is not
    recognised
docstr_tok: ["Gets","centroid","initializer",".","Args",":","init_method",":","a","CentroidInitialization","value","representing","the","init","method","requested","Returns",":","A","concrete","implementation","of","AbstractCentroidsInitialisation","Raises",":","ValueError","if","the","requested","centroid","initialization","method","is","not","recognised"]
code: def get_centroid_initializer(cls, init_method):
      """Gets centroid initializer.
  
      Args:
        init_method: a CentroidInitialization value representing the init
        method requested
      Returns:
        A concrete implementation of AbstractCentroidsInitialisation
      Raises:
        ValueError if the requested centroid initialization method is not
        recognised
      """
      if not cls.init_is_supported(init_method):
          raise ValueError(
              "Unknown initialisation method: {init_method}. Allowed values are : "
              "{allowed}".format(
                  init_method=init_method,
                  allowed=",".join(cls._initialisers.keys()),
              )
          )
  
      return cls._initialisers[init_method]
  
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 2 for calling the CentroidsInitializerFactory obj's underlying member method code with example usage: obj.get_centroid_initializer(cls, init_method) and returns: cls