class_docstr: Patchcore Module.
class_docstr_tok: ["Patchcore","Module","."]
docstr: Subsample embedding based on coreset sampling and store to memory.
  
  Args:
      embedding (np.ndarray): Embedding tensor from the CNN
      sampling_ratio (float): Coreset sampling ratio
docstr_tok: ["Subsample","embedding","based","on","coreset","sampling","and","store","to","memory",".","Args",":","embedding","(","np.ndarray",")",":","Embedding","tensor","from","the","CNN","sampling_ratio","(","float",")",":","Coreset","sampling","ratio"]
code: def subsample_embedding(
      self, embedding: Tensor, sampling_ratio: float
  ) -> None:
      """Subsample embedding based on coreset sampling and store to memory.
  
      Args:
          embedding (np.ndarray): Embedding tensor from the CNN
          sampling_ratio (float): Coreset sampling ratio
      """
  
      # Coreset Subsampling
      sampler = KCenterGreedy(
          embedding=embedding, sampling_ratio=sampling_ratio
      )
      coreset = sampler.sample_coreset()
      self.memory_bank = coreset
  
file_path: anomalib/src/anomalib/models/patchcore/torch_model.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from anomalib.models.components import DynamicBufferModule, FeatureExtractor, KCenterGreedy
  from anomalib.models.patchcore.anomaly_map import AnomalyMapGenerator
  from anomalib.pre_processing import Tiler
label_desc: Use image node_id 5 for calling the PatchcoreModel obj's underlying member method code with example usage: obj.subsample_embedding(embedding, sampling_ratio) without return types