class_docstr: Gibbs sampling [@geman1984stochastic].
  
  Note `Gibbs` assumes the proposal distribution has the same
  support as the prior. The `auto_transform` attribute in
  the method `initialize()` is not applicable.
  
  #### Examples
  
  ```python
  x_data = np.array([0, 1, 0, 0, 0, 0, 0, 0, 0, 1])
  
  p = Beta(1.0, 1.0)
  x = Bernoulli(probs=p, sample_shape=10)
  
  qp = Empirical(tf.Variable(tf.zeros(500)))
  inference = ed.Gibbs({p: qp}, data={x: x_data})
  ```
class_docstr_tok: ["Gibbs","sampling","[","@","geman1984stochastic","]",".","Note","`","Gibbs","`","assumes","the","proposal","distribution","has","the","same","support","as","the","prior",".","The","`","auto_transform","`","attribute","in","the","method","`","initialize","(",")","`","is","not","applicable",".","#","#","#","#","Examples","``","`","python","x_data","=","np.array","(","[","0",",","1",",","0",",","0",",","0",",","0",",","0",",","0",",","0",",","1","]",")","p","=","Beta","(","1.0",",","1.0",")","x","=","Bernoulli","(","probs=p",",","sample_shape=10",")","qp","=","Empirical","(","tf.Variable","(","tf.zeros","(","500",")",")",")","inference","=","ed.Gibbs","(","{","p",":","qp","}",",","data=","{","x",":","x_data","}",")","``","`"]
docstr: Create an inference algorithm.
  
  Args:
    proposal_vars: dict of RandomVariable to RandomVariable.
      Collection of random variables to perform inference on; each is
      binded to its complete conditionals which Gibbs cycles draws on.
      If not specified, default is to use `ed.complete_conditional`.
docstr_tok: ["Create","an","inference","algorithm",".","Args",":","proposal_vars",":","dict","of","RandomVariable","to","RandomVariable",".","Collection","of","random","variables","to","perform","inference","on",";","each","is","binded","to","its","complete","conditionals","which","Gibbs","cycles","draws","on",".","If","not","specified",",","default","is","to","use","`","ed.complete_conditional","`","."]
code: def __init__(self, latent_vars, proposal_vars=None, data=None):
      """Create an inference algorithm.
  
      Args:
        proposal_vars: dict of RandomVariable to RandomVariable.
          Collection of random variables to perform inference on; each is
          binded to its complete conditionals which Gibbs cycles draws on.
          If not specified, default is to use `ed.complete_conditional`.
      """
      super(Gibbs, self).__init__(latent_vars, data)
  
      if proposal_vars is None:
          proposal_vars = {
              z: complete_conditional(z)
              for z in six.iterkeys(self.latent_vars)
          }
      else:
          check_latent_vars(proposal_vars)
  
      self.proposal_vars = proposal_vars
  
file_path: edward/edward/inferences/gibbs.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import random
  import six
  import tensorflow
  from collections import OrderedDict
  from edward.inferences.conjugacy import complete_conditional
  from edward.inferences.monte_carlo import MonteCarlo
  from edward.models import RandomVariable
  from edward.util import check_latent_vars, get_session
label_desc: Use image node_id 1 to create a new Gibbs object from inherited base classes: MonteCarlo with example: obj = Gibbs(latent_vars, proposal_vars, data)