class_docstr: Preconditioning reparameterizer of multiple latent variables.
  
  This uses a trained :class:`~pyro.infer.autoguide.AutoStructured`
  guide to alter the geometry of a model, typically for use e.g. in MCMC.
  Example usage::
  
      # Step 1. Train a guide
      guide = AutoStructured(model, ...)
      svi = SVI(model, guide, ...)
      # ...train the guide...
  
      # Step 2. Use trained guide in preconditioned MCMC
      model = StructuredReparam(guide).reparam(model)
      nuts = NUTS(model)
      # ...now use the model in HMC or NUTS...
  
  This reparameterization works only for latent variables, not likelihoods.
  Note that all sites must share a single common :class:`StructuredReparam`
  instance, and that the model must have static structure.
  
  .. note:: This can be seen as a restricted structured version of
      :class:`~pyro.infer.reparam.neutra.NeuTraReparam` [1] combined with
      ``poutine.condition`` on MAP-estimated sites (the NeuTra transform is
      an exact reparameterizer, but the conditioning to point estimates
      introduces model approximation).
  
  [1] Hoffman, M. et al. (2019)
      "NeuTra-lizing Bad Geometry in Hamiltonian Monte Carlo Using Neural Transport"
      https://arxiv.org/abs/1903.03704
  
  :param ~pyro.infer.autoguide.AutoStructured guide: A trained guide.
class_docstr_tok: ["Preconditioning","reparameterizer","of","multiple","latent","variables",".","This","uses","a","trained",":","class",":","`","~pyro.infer.autoguide.AutoStructured","`","guide","to","alter","the","geometry","of","a","model",",","typically","for","use","e.g",".","in","MCMC",".","Example","usage",":",":","#","Step","1",".","Train","a","guide","guide","=","AutoStructured","(","model",",","...",")","svi","=","SVI","(","model",",","guide",",","...",")","#","...","train","the","guide","...","#","Step","2",".","Use","trained","guide","in","preconditioned","MCMC","model","=","StructuredReparam","(","guide",")",".reparam","(","model",")","nuts","=","NUTS","(","model",")","#","...","now","use","the","model","in","HMC","or","NUTS","...","This","reparameterization","works","only","for","latent","variables",",","not","likelihoods",".","Note","that","all","sites","must","share","a","single","common",":","class",":","`","StructuredReparam","`","instance",",","and","that","the","model","must","have","static","structure",".","..","note",":",":","This","can","be","seen","as","a","restricted","structured","version","of",":","class",":","`","~pyro.infer.reparam.neutra.NeuTraReparam","`","[","1","]","combined","with","``","poutine.condition","``","on","MAP-estimated","sites","(","the","NeuTra","transform","is","an","exact","reparameterizer",",","but","the","conditioning","to","point","estimates","introduces","model","approximation",")",".","[","1","]","Hoffman",",","M.","et","al",".","(","2019",")","``","NeuTra-lizing","Bad","Geometry","in","Hamiltonian","Monte","Carlo","Using","Neural","Transport","''","https",":","\/\/arxiv.org\/abs\/1903.03704",":","param","~pyro.infer.autoguide.AutoStructured","guide",":","A","trained","guide","."]
code: def _reparam_config(self, site):
      if site["name"] in self.guide.prototype_trace:
          return self
  
file_path: pyro/pyro/infer/reparam/structured.py
imports: from contextlib import ExitStack
  import pyro.distributions
  from pyro import poutine
  from pyro.infer.autoguide.structured import AutoStructured
  from pyro.poutine.plate_messenger import block_plate
  from .reparam import Reparam
label_desc: Use image node_id 2 for calling the StructuredReparam obj's underlying member method code with example usage: obj._reparam_config(site) and returns: self