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])
code: def __init__(self, embedding: Tensor, sampling_ratio: float) -> None:
      assert sampling_ratio < 1
      assert sampling_ratio > 0
      self.embedding = embedding
      self.coreset_size = int(embedding.shape[0] * sampling_ratio)
      self.model = SparseRandomProjection(eps=0.9)
  
      self.features: Tensor
      self.min_distances: Tensor = None
      self.n_observations = self.embedding.shape[0]
  
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 1 to create a new KCenterGreedy object  with example: obj = KCenterGreedy(embedding, sampling_ratio)