docstr: Set aside reference samples to act as kernel centers
docstr_tok: ["Set","aside","reference","samples","to","act","as","kernel","centers"]
code: def _configure_kernel_centers(self, x_ref: torch.Tensor):
      "Set aside reference samples to act as kernel centers"
      perm = torch.randperm(self.x_ref.shape[0])
      c_inds, non_c_inds = (
          perm[: self.n_kernel_centers],
          perm[self.n_kernel_centers :],
      )
      self.kernel_centers = x_ref[c_inds]
      if (
          np.unique(self.kernel_centers.cpu().numpy(), axis=0).shape[0]
          < self.n_kernel_centers
      ):
          perturbation = (
              torch.randn(self.kernel_centers.shape) * 1e-6
          ).to(self.device)
          self.kernel_centers = self.kernel_centers + perturbation
      x_ref_eff = x_ref[non_c_inds]  # the effective reference set
      self.k_xc = self.kernel(x_ref_eff, self.kernel_centers)
  
file_path: alibi-detect/alibi_detect/cd/pytorch/lsdd.py
imports: import numpy
  import torch
  from typing import Callable, Dict, Optional, Tuple, Union
  from alibi_detect.cd.base import BaseLSDDDrift
  from alibi_detect.utils.pytorch import get_device
  from alibi_detect.utils.pytorch.kernels import GaussianRBF
  from alibi_detect.utils.pytorch.distance import permed_lsdds
  from alibi_detect.utils.warnings import deprecated_alias
  from alibi_detect.utils.frameworks import Framework
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 4 for calling the LSDDDriftTorch obj's underlying member method code with example usage: obj._configure_kernel_centers(x_ref) without return types