class_docstr: Abstract base class for Monte Carlo. Specific Monte Carlo methods
  inherit from `MonteCarlo`, sharing methods in this class.
  
  To build an algorithm inheriting from `MonteCarlo`, one must at the
  minimum implement `build_update`: it determines how to assign
  the samples in the `Empirical` approximations.
  
  #### Notes
  
  The number of Monte Carlo iterations is set according to the
  minimum of all `Empirical` sizes.
  
  Initialization is assumed from `params[0, :]`. This generalizes
  initializing randomly and initializing from user input. Updates
  are along this outer dimension, where iteration t updates
  `params[t, :]` in each `Empirical` random variable.
  
  No warm-up is implemented. Users must run MCMC for a long period
  of time, then manually burn in the Empirical random variable.
  
  #### Examples
  
  Most explicitly, `MonteCarlo` is specified via a dictionary:
  
  ```python
  qpi = Empirical(params=tf.Variable(tf.zeros([T, K-1])))
  qmu = Empirical(params=tf.Variable(tf.zeros([T, K*D])))
  qsigma = Empirical(params=tf.Variable(tf.zeros([T, K*D])))
  ed.MonteCarlo({pi: qpi, mu: qmu, sigma: qsigma}, data)
  ```
  
  The inferred posterior is comprised of `Empirical` random
  variables with `T` samples. We also automate the specification
  of `Empirical` random variables. One can pass in a list of
  latent variables instead:
  
  ```python
  ed.MonteCarlo([beta], data)
  ed.MonteCarlo([pi, mu, sigma], data)
  ```
  
  It defaults to `Empirical` random variables with 10,000 samples for
  each dimension.
class_docstr_tok: ["Abstract","base","class","for","Monte","Carlo",".","Specific","Monte","Carlo","methods","inherit","from","`","MonteCarlo","`",",","sharing","methods","in","this","class",".","To","build","an","algorithm","inheriting","from","`","MonteCarlo","`",",","one","must","at","the","minimum","implement","`","build_update","`",":","it","determines","how","to","assign","the","samples","in","the","`","Empirical","`","approximations",".","#","#","#","#","Notes","The","number","of","Monte","Carlo","iterations","is","set","according","to","the","minimum","of","all","`","Empirical","`","sizes",".","Initialization","is","assumed","from","`","params","[","0",",",":","]","`",".","This","generalizes","initializing","randomly","and","initializing","from","user","input",".","Updates","are","along","this","outer","dimension",",","where","iteration","t","updates","`","params","[","t",",",":","]","`","in","each","`","Empirical","`","random","variable",".","No","warm-up","is","implemented",".","Users","must","run","MCMC","for","a","long","period","of","time",",","then","manually","burn","in","the","Empirical","random","variable",".","#","#","#","#","Examples","Most","explicitly",",","`","MonteCarlo","`","is","specified","via","a","dictionary",":","``","`","python","qpi","=","Empirical","(","params=tf.Variable","(","tf.zeros","(","[","T",",","K-1","]",")",")",")","qmu","=","Empirical","(","params=tf.Variable","(","tf.zeros","(","[","T",",","K","*","D","]",")",")",")","qsigma","=","Empirical","(","params=tf.Variable","(","tf.zeros","(","[","T",",","K","*","D","]",")",")",")","ed.MonteCarlo","(","{","pi",":","qpi",",","mu",":","qmu",",","sigma",":","qsigma","}",",","data",")","``","`","The","inferred","posterior","is","comprised","of","`","Empirical","`","random","variables","with","`","T","`","samples",".","We","also","automate","the","specification","of","`","Empirical","`","random","variables",".","One","can","pass","in","a","list","of","latent","variables","instead",":","``","`","python","ed.MonteCarlo","(","[","beta","]",",","data",")","ed.MonteCarlo","(","[","pi",",","mu",",","sigma","]",",","data",")","``","`","It","defaults","to","`","Empirical","`","random","variables","with","10,000","samples","for","each","dimension","."]
docstr: Build update rules, returning an assign op for parameters in
  the `Empirical` random variables.
  
  Any derived class of `MonteCarlo` **must** implement this method.
  
  Raises:
    NotImplementedError.
docstr_tok: ["Build","update","rules",",","returning","an","assign","op","for","parameters","in","the","`","Empirical","`","random","variables",".","Any","derived","class","of","`","MonteCarlo","`","*","*","must","*","*","implement","this","method",".","Raises",":","NotImplementedError","."]
code: def build_update(self):
      """Build update rules, returning an assign op for parameters in
      the `Empirical` random variables.
  
      Any derived class of `MonteCarlo` **must** implement this method.
  
      Raises:
        NotImplementedError.
      """
      raise NotImplementedError()
  
file_path: edward/edward/inferences/monte_carlo.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import numpy
  import six
  import tensorflow
  from edward.inferences.inference import Inference
  from edward.models import Empirical, RandomVariable
  from edward.util import get_session
label_desc: Use image node_id 5 for calling the MonteCarlo obj's underlying member method code with example usage: obj.build_update() without return types