class_docstr: Implements k-center-greedy method.
  
  Args:
      embedding (Tensor): Embedding vector extracted from a CNN
      sampling_ratio (float): Ratio to choose coreset size from the embedding size.
  
  Example:
      >>> embedding.shape
      paddle.Size([219520, 1536])
      >>> sampler = KCenterGreedy(embedding=embedding)
      >>> sampled_idxs = sampler.select_coreset_idxs()
      >>> coreset = embedding[sampled_idxs]
      >>> coreset.shape
      paddle.Size([219, 1536])
docstr: Update min distances given cluster centers.
  
  Args:
      cluster_centers (List[int]): indices of cluster centers
docstr_tok: ["Update","min","distances","given","cluster","centers",".","Args",":","cluster_centers","(","List","[","int","]",")",":","indices","of","cluster","centers"]
code: def update_distances(self, cluster_centers: List[int]) -> None:
      """Update min distances given cluster centers.
  
      Args:
          cluster_centers (List[int]): indices of cluster centers
      """
  
      if cluster_centers:
          centers = self.features[cluster_centers]
          distance = pairwise_distance(self.features, centers).reshape(
              (-1, 1)
          )
  
          if self.min_distances is None:
              self.min_distances = distance
          else:
              self.min_distances = paddle.minimum(
                  self.min_distances, distance
              )
  
file_path: PaddleSeg/contrib/QualityInspector/qinspector/uad/utils/k_center_greedy.py
imports: from typing import List, Optional
  import paddle
  from paddle import Tensor
  from .random_projection import SparseRandomProjection
label_desc: Use image node_id 3 for calling the KCenterGreedy obj's underlying member method code with example usage: obj.update_distances(cluster_centers) without return types