class_docstr: Compiled Sequential Importance Sampling, allowing compilation of a guide
  program to minimise KL(model posterior || guide), and inference with
  importance sampling.
  
  **Reference**
  "Inference Compilation and Universal Probabilistic Programming" `pdf https://arxiv.org/pdf/1610.09900.pdf`
  
  :param model: probabilistic model defined as a function. Must accept a
      keyword argument named `observations`, in which observed values are
      passed as, with the names of nodes as the keys.
  :param guide: guide function which is used as an approximate posterior. Must
      also accept `observations` as keyword argument.
  :param optim: a Pyro optimizer
  :type optim: pyro.optim.PyroOptim
  :param num_inference_samples: The number of importance-weighted samples to
      draw during inference.
  :param training_batch_size: Number of samples to use to approximate the loss
      before each gradient descent step during training.
  :param validation_batch_size: Number of samples to use for calculating
      validation loss (will only be used if `.validation_loss` is called).
class_docstr_tok: ["Compiled","Sequential","Importance","Sampling",",","allowing","compilation","of","a","guide","program","to","minimise","KL","(","model","posterior","||","guide",")",",","and","inference","with","importance","sampling",".","*","*","Reference","*","*","''","Inference","Compilation","and","Universal","Probabilistic","Programming","''","`","pdf","https",":","\/\/arxiv.org\/pdf\/1610.09900.pdf","`",":","param","model",":","probabilistic","model","defined","as","a","function",".","Must","accept","a","keyword","argument","named","`","observations","`",",","in","which","observed","values","are","passed","as",",","with","the","names","of","nodes","as","the","keys",".",":","param","guide",":","guide","function","which","is","used","as","an","approximate","posterior",".","Must","also","accept","`","observations","`","as","keyword","argument",".",":","param","optim",":","a","Pyro","optimizer",":","type","optim",":","pyro.optim.PyroOptim",":","param","num_inference_samples",":","The","number","of","importance-weighted","samples","to","draw","during","inference",".",":","param","training_batch_size",":","Number","of","samples","to","use","to","approximate","the","loss","before","each","gradient","descent","step","during","training",".",":","param","validation_batch_size",":","Number","of","samples","to","use","for","calculating","validation","loss","(","will","only","be","used","if","`",".validation_loss","`","is","called",")","."]
code: def _differentiable_loss_particle(self, guide_trace):
      return -guide_trace.log_prob_sum()
  
file_path: pyro/pyro/infer/csis.py
imports: import itertools
  import torch
  import pyro
  import pyro.poutine
  from pyro.infer.importance import Importance
  from pyro.infer.util import torch_item
  from pyro.poutine.util import prune_subsample_sites
  from pyro.util import check_model_guide_match, warn_if_nan
label_desc: Use image node_id 5 for calling the CSIS obj's underlying member method code with example usage: obj._differentiable_loss_particle(guide_trace) and returns: unknown