FAISS 聚类使用记录

  1. spherical的作用

  2. maxpointsper_centroid说明

    根据官方文档GPU k means example所述
    该值设置了256的默认值,对某些大数据集来说需要更改为
    ((numVecsToCluster + numberOfClusters - 1) / numberOfClusters)

      // By default faiss only samples 256 vectors per centroid, in case
      // you are asking for too few centroids for too many vectors.
      // e.g., numberOfClusters = 1000, numVecsToCluster = 1000000 would
      // only sample 256000 vectors.
      //
      // You can override this to use any number of clusters
      // cp.max_points_per_centroid =
      //   ((numVecsToCluster + numberOfClusters - 1) / numberOfClusters);
    

    在python版faiss更改该值的方法

kmeans = faiss.Kmeans(648, 1024, 20, True)
kmeans.cp.max_points_per_centroid = 2560
  1. 3

你可能感兴趣的:(机器学习)