class_docstr: Replica Exchange MCMC [@swendsen1986replica; @hukushima1996exchange].
  
  #### Examples
  ```python
  cat = Categorical(probs=[0.5,0.5])
  x = Mixture(cat=cat, components=[
      MultivariateNormalDiag([0.0,0.0], [1.0,1.0]),
      MultivariateNormalDiag([10.0,10.0], [1.0,1.0])])
  proposal_x = MultivariateNormalDiag(x, [1.0,1.0])
  qx = Empirical(tf.Variable(tf.zeros([10000, 2])))
  inference = ed.ReplicaExchangeMC(latent_vars={x: qx},
                                   proposal_vars={x: proposal_x})
  ```
class_docstr_tok: ["Replica","Exchange","MCMC","[","@","swendsen1986replica",";","@","hukushima1996exchange","]",".","#","#","#","#","Examples","``","`","python","cat","=","Categorical","(","probs=","[","0.5,0.5","]",")","x","=","Mixture","(","cat=cat",",","components=","[","MultivariateNormalDiag","(","[","0.0,0.0","]",",","[","1.0,1.0","]",")",",","MultivariateNormalDiag","(","[","10.0,10.0","]",",","[","1.0,1.0","]",")","]",")","proposal_x","=","MultivariateNormalDiag","(","x",",","[","1.0,1.0","]",")","qx","=","Empirical","(","tf.Variable","(","tf.zeros","(","[","10000",",","2","]",")",")",")","inference","=","ed.ReplicaExchangeMC","(","latent_vars=","{","x",":","qx","}",",","proposal_vars=","{","x",":","proposal_x","}",")","``","`"]
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 a proposal distribution $g(z' \mid z)$.
    inverse_temperatures: list of inverse temperature.
    exchange_freq: frequency of exchanging replica.
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","a","proposal","distribution","$","g","(","z","'","\\mid","z",")","$",".","inverse_temperatures",":","list","of","inverse","temperature",".","exchange_freq",":","frequency","of","exchanging","replica","."]
code: def __init__(
      self,
      latent_vars,
      proposal_vars,
      data=None,
      inverse_temperatures=np.logspace(0, -2, 5),
      exchange_freq=0.1,
  ):
      """Create an inference algorithm.
  
      Args:
        proposal_vars: dict of RandomVariable to RandomVariable.
          Collection of random variables to perform inference on; each is
          binded to a proposal distribution $g(z' \mid z)$.
        inverse_temperatures: list of inverse temperature.
        exchange_freq: frequency of exchanging replica.
      """
      check_latent_vars(proposal_vars)
      self.proposal_vars = proposal_vars
      super(ReplicaExchangeMC, self).__init__(latent_vars, data)
  
      self.n_replica = len(inverse_temperatures)
      if inverse_temperatures[0] != 1:
          raise ValueError("inverse_temperatures[0] must be 1.")
      self.inverse_temperatures = tf.cast(
          inverse_temperatures, dtype=list(self.latent_vars)[0].dtype
      )
  
      # Make replica.
      self.replica_vars = []
      for i in range(self.n_replica):
          self.replica_vars.append(
              {
                  z: Empirical(
                      params=tf.Variable(
                          tf.zeros(
                              qz.params.shape,
                              dtype=self.latent_vars[z].dtype,
                          )
                      )
                  )
                  for z, qz in six.iteritems(self.latent_vars)
              }
          )
  
      self.exchange_freq = exchange_freq
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  import tensorflow
  import numpy
  from collections import OrderedDict
  from edward.inferences.monte_carlo import MonteCarlo
  from edward.models import Empirical, RandomVariable
  from edward.util import check_latent_vars, copy
label_desc: Use image node_id 1 to create a new ReplicaExchangeMC object from inherited base classes: MonteCarlo with example: obj = ReplicaExchangeMC(latent_vars, proposal_vars, data, inverse_temperatures, exchange_freq)