class_docstr: Parameter estimation with GAN-style training
  [@goodfellow2014generative].
  
  Works for the class of implicit (and differentiable) probabilistic
  models. These models do not require a tractable density and assume
  only a program that generates samples.
  
  #### Notes
  
  `GANInference` does not support latent variable inference. Note
  that GAN-style training also samples from the prior: this does not
  work well for latent variables that are shared across many data
  points (global variables).
  
  In building the computation graph for inference, the
  discriminator's parameters can be accessed with the variable scope
  "Disc".
  
  GANs also only work for one observed random variable in `data`.
  
  The objective function also adds to itself a summation over all
  tensors in the `REGULARIZATION_LOSSES` collection.
  
  #### Examples
  
  ```python
  z = Normal(loc=tf.zeros([100, 10]), scale=tf.ones([100, 10]))
  x = generative_network(z)
  
  inference = ed.GANInference({x: x_data}, discriminator)
  ```
docstr: Create an inference algorithm.
  
  Args:
    data: dict.
      Data dictionary which binds observed variables (of type
      `RandomVariable` or `tf.Tensor`) to their realizations (of
      type `tf.Tensor`).  It can also bind placeholders (of type
      `tf.Tensor`) used in the model to their realizations.
    discriminator: function.
      Function (with parameters) to discriminate samples. It should
      output logit probabilities (real-valued) and not probabilities
      in $[0, 1]$.
docstr_tok: ["Create","an","inference","algorithm",".","Args",":","data",":","dict",".","Data","dictionary","which","binds","observed","variables","(","of","type","`","RandomVariable","`","or","`","tf.Tensor","`",")","to","their","realizations","(","of","type","`","tf.Tensor","`",")",".","It","can","also","bind","placeholders","(","of","type","`","tf.Tensor","`",")","used","in","the","model","to","their","realizations",".","discriminator",":","function",".","Function","(","with","parameters",")","to","discriminate","samples",".","It","should","output","logit","probabilities","(","real-valued",")","and","not","probabilities","in","$","[","0",",","1","]","$","."]
code: def __init__(self, data, discriminator):
      """Create an inference algorithm.
  
      Args:
        data: dict.
          Data dictionary which binds observed variables (of type
          `RandomVariable` or `tf.Tensor`) to their realizations (of
          type `tf.Tensor`).  It can also bind placeholders (of type
          `tf.Tensor`) used in the model to their realizations.
        discriminator: function.
          Function (with parameters) to discriminate samples. It should
          output logit probabilities (real-valued) and not probabilities
          in $[0, 1]$.
      """
      if not callable(discriminator):
          raise TypeError("discriminator must be a callable function.")
  
      self.discriminator = discriminator
      super(GANInference, self).__init__(None, data)
  
file_path: edward/edward/inferences/gan_inference.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  import tensorflow
  from edward.inferences.variational_inference import VariationalInference
  from edward.util import get_session
label_desc: Use image node_id 1 to create a new GANInference object from inherited base classes: VariationalInference with example: obj = GANInference(data, discriminator)