class_docstr: An IMQ (inverse multi-quadratic) kernel for use in the SVGD inference algorithm [1]. The bandwidth of the kernel
  is chosen from the particles using a simple heuristic as in reference [2]. The kernel takes the form
  
  :math:`K(x, y) = (\alpha + ||x-y||^2/h)^{\beta}`
  
  where :math:`\alpha` and :math:`\beta` are user-specified parameters and :math:`h` is the bandwidth.
  
  :param float alpha: Kernel hyperparameter, defaults to 0.5.
  :param float beta: Kernel hyperparameter, defaults to -0.5.
  :param float bandwidth_factor: Optional factor by which to scale the bandwidth, defaults to 1.0.
  :ivar float ~.bandwidth_factor: Property that controls the factor by which to scale the bandwidth
      at each iteration.
  
  References
  
  [1] "Stein Points," Wilson Ye Chen, Lester Mackey, Jackson Gorham, Francois-Xavier Briol, Chris. J. Oates.
  [2] "Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithm," Qiang Liu, Dilin Wang
code: def log_kernel_and_grad(self, particles):
      delta_x = particles.unsqueeze(0) - particles.unsqueeze(1)  # N N D
      assert delta_x.dim() == 3
      norm_sq = delta_x.pow(2.0)  # N N D
      h = self._bandwidth(norm_sq)  # D
      base_term = self.alpha + norm_sq / h
      log_kernel = self.beta * torch.log(base_term)  # N N D
      grad_term = (-2.0 * self.beta) * delta_x / h  # N N D
      grad_term = grad_term / base_term
      assert log_kernel.shape == grad_term.shape
      return log_kernel, grad_term
  
imports: import math
  from abc import ABCMeta, abstractmethod
  import torch
  from torch.distributions import biject_to
  import pyro
  from pyro import poutine
  from pyro.distributions import Delta
  from pyro.distributions.util import copy_docs_from
  from pyro.infer.autoguide.guides import AutoContinuous
  from pyro.infer.autoguide.initialization import init_to_sample
  from pyro.infer.trace_elbo import Trace_ELBO
label_desc: Use image node_id 3 for calling the IMQSteinKernel obj's underlying member method code with example usage: obj.log_kernel_and_grad(particles) and returns: log_kernel,  grad_term