docstr: Configure the normalization functions used to normalize reference and test data to zero mean and unit variance.
  The reference data `x_ref` is also normalized here.
docstr_tok: ["Configure","the","normalization","functions","used","to","normalize","reference","and","test","data","to","zero","mean","and","unit","variance",".","The","reference","data","`","x_ref","`","is","also","normalized","here","."]
code: def _configure_normalization(self, eps: float = 1e-12):
      """
      Configure the normalization functions used to normalize reference and test data to zero mean and unit variance.
      The reference data `x_ref` is also normalized here.
      """
      x_ref = torch.from_numpy(self.x_ref).to(self.device)
      x_ref_means = x_ref.mean(0)
      x_ref_stds = x_ref.std(0)
      self._normalize = lambda x: (x - x_ref_means) / (x_ref_stds + eps)
      self._unnormalize = (
          lambda x: (
              torch.as_tensor(x) * (x_ref_stds + eps) + x_ref_means
          )
          .cpu()
          .numpy()
      )
      self.x_ref = self._normalize(x_ref).cpu().numpy()
  
file_path: alibi-detect/alibi_detect/cd/pytorch/lsdd_online.py
imports: from tqdm import tqdm
  import numpy
  import torch
  from typing import Any, Callable, Optional, Union
  from alibi_detect.cd.base_online import BaseMultiDriftOnline
  from alibi_detect.utils.pytorch import get_device
  from alibi_detect.utils.pytorch import GaussianRBF, permed_lsdds, quantile
  from alibi_detect.utils.frameworks import Framework
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 2 for calling the LSDDDriftOnlineTorch obj's underlying member method code with example usage: obj._configure_normalization(eps) without return types