class_docstr: An implementation of Renyi's :math:`\alpha`-divergence variational inference
  following reference [1].
  
  In order for the objective to be a strict lower bound, we require
  :math:`\alpha \ge 0`. Note, however, that according to reference [1], depending
  on the dataset :math:`\alpha < 0` might give better results. In the special case
  :math:`\alpha = 0`, the objective function is that of the important weighted
  autoencoder derived in reference [2].
  
  .. note:: Setting :math:`\alpha < 1` gives a better bound than the usual ELBO.
      For :math:`\alpha = 1`, it is better to use
      :class:`~pyro.infer.trace_elbo.Trace_ELBO` class because it helps reduce
      variances of gradient estimations.
  
  :param float alpha: The order of :math:`\alpha`-divergence. Here
      :math:`\alpha \neq 1`. Default is 0.
  :param num_particles: The number of particles/samples used to form the objective
      (gradient) estimator. Default is 2.
  :param int max_plate_nesting: Bound on max number of nested
      :func:`pyro.plate` contexts. Default is infinity.
  :param bool strict_enumeration_warning: Whether to warn about possible
      misuse of enumeration, i.e. that
      :class:`~pyro.infer.traceenum_elbo.TraceEnum_ELBO` is used iff there
      are enumerated sample sites.
  
  References:
  
  [1] `Renyi Divergence Variational Inference`,
      Yingzhen Li, Richard E. Turner
  
  [2] `Importance Weighted Autoencoders`,
      Yuri Burda, Roger Grosse, Ruslan Salakhutdinov
code: def __init__(
      self,
      alpha=0,
      num_particles=2,
      max_plate_nesting=float("inf"),
      max_iarange_nesting=None,  # DEPRECATED
      vectorize_particles=False,
      strict_enumeration_warning=True,
  ):
      if max_iarange_nesting is not None:
          warnings.warn(
              "max_iarange_nesting is deprecated; use max_plate_nesting instead",
              DeprecationWarning,
          )
          max_plate_nesting = max_iarange_nesting
  
      if alpha == 1:
          raise ValueError(
              "The order alpha should not be equal to 1. Please use Trace_ELBO class"
              "for the case alpha = 1."
          )
      self.alpha = alpha
      super().__init__(
          num_particles=num_particles,
          max_plate_nesting=max_plate_nesting,
          vectorize_particles=vectorize_particles,
          strict_enumeration_warning=strict_enumeration_warning,
      )
  
file_path: pyro/pyro/infer/renyi_elbo.py
imports: import math
  import warnings
  import torch
  from pyro.distributions.util import is_identically_zero
  from pyro.infer.elbo import ELBO
  from pyro.infer.enum import get_importance_trace
  from pyro.infer.util import get_dependent_plate_dims, is_validation_enabled, torch_sum
  from pyro.util import check_if_enumerated, warn_if_nan
label_desc: Use image node_id 1 to create a new RenyiELBO object from inherited base classes: ELBO with example: obj = RenyiELBO(alpha, num_particles, max_plate_nesting, max_iarange_nesting, vectorize_particles, strict_enumeration_warning)