class_docstr: Object that performs k-means clustering and manages the centroids.
  The `Kmeans` class is essentially a wrapper around the C++ `Clustering` object.
  
  Parameters
  ----------
  d : int
     dimension of the vectors to cluster
  k : int
     number of clusters
  gpu: bool or int, optional
     False: don't use GPU
     True: use all GPUs
     number: use this many GPUs
  progressive_dim_steps:
      use a progressive dimension clustering (with that number of steps)
  
  Subsequent parameters are fields of the Clustring object. The most important are:
  
  niter: int, optional
     clustering iterations
  nredo: int, optional
     redo clustering this many times and keep best
  verbose: bool, optional
  spherical: bool, optional
     do we want normalized centroids?
  int_centroids: bool, optional
     round centroids coordinates to integer
  seed: int, optional
     seed for the random number generator
docstr: d: input dimension, k: nb of centroids. Additional
  parameters are passed on the ClusteringParameters object,
  including niter=25, verbose=False, spherical = False
docstr_tok: ["d",":","input","dimension",",","k",":","nb","of","centroids",".","Additional","parameters","are","passed","on","the","ClusteringParameters","object",",","including","niter=25",",","verbose=False",",","spherical","=","False"]
code: def __init__(self, d, k, **kwargs):
      """d: input dimension, k: nb of centroids. Additional
      parameters are passed on the ClusteringParameters object,
      including niter=25, verbose=False, spherical = False
      """
      self.d = d
      self.reset(k)
      self.gpu = False
      if "progressive_dim_steps" in kwargs:
          self.cp = ProgressiveDimClusteringParameters()
      else:
          self.cp = ClusteringParameters()
      for k, v in kwargs.items():
          if k == "gpu":
              if v == True or v == -1:
                  v = get_num_gpus()
              self.gpu = v
          else:
              # if this raises an exception, it means that it is a non-existent field
              getattr(self.cp, k)
              setattr(self.cp, k, v)
      self.set_index()
  
imports: import numpy
  from faiss.loader import *
  import faiss
  import collections.abc
label_desc: Use image node_id 1 to create a new Kmeans object  with example: obj = Kmeans(d, k)