class_docstr: A kernel that supports spectral learning for GPs, where the underlying spectral density is modeled as a mixture
  of delta distributions (e.g., with point masses). This has been explored e.g. in Lazaro-Gredilla et al., 2010.
  
  Conceptually, this kernel is similar to random Fourier features as implemented in RFFKernel, but instead of sampling
  a Gaussian to determine the spectrum sites, they are treated as learnable parameters.
  
  When using CG for inference, this kernel supports linear space and time (in N) for training and inference.
  
  :param int num_dims: Dimensionality of input data that this kernel will operate on. Note that if active_dims is
      used, this should be the length of the active dim set.
  :param int num_deltas: Number of point masses to learn.
code: def initialize_from_data_simple(self, train_x, train_y, **kwargs):
      if not torch.is_tensor(train_x) or not torch.is_tensor(train_y):
          raise RuntimeError("train_x and train_y should be tensors")
      if train_x.ndimension() == 1:
          train_x = train_x.unsqueeze(-1)
      if train_x.ndimension() == 2:
          train_x = train_x.unsqueeze(0)
  
      train_x_sort = train_x.sort(1)[0]
      min_dist_sort = (
          train_x_sort[:, 1:, :] - train_x_sort[:, :-1, :]
      ).squeeze(0)
      ard_num_dims = (
          1 if self.ard_num_dims is None else self.ard_num_dims
      )
      min_dist = torch.zeros(
          1, ard_num_dims, dtype=self.Z.dtype, device=self.Z.device
      )
      for ind in range(ard_num_dims):
          min_dist[:, ind] = min_dist_sort[
              (torch.nonzero(min_dist_sort[:, ind]))[0], ind
          ]
  
      z_init = torch.rand_like(self.Z).mul_(0.5).div_(min_dist)
  
      self.Z = z_init
  
file_path: gpytorch/gpytorch/kernels/spectral_delta_kernel.py
imports: import math
  from typing import Optional
  import torch
  from linear_operator.operators import MatmulLinearOperator, RootLinearOperator
  from ..constraints import Interval, Positive
  from .kernel import Kernel
label_desc: Use image node_id 3 for calling the SpectralDeltaKernel obj's underlying member method code with example usage: obj.initialize_from_data_simple(train_x, train_y) without return types