class_docstr: Parameter estimation with GAN-style training
  [@goodfellow2014generative], using the Wasserstein distance
  [@arjovsky2017wasserstein].
  
  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
  
  Argument-wise, the only difference from `GANInference` is
  conceptual: the `discriminator` is better described as a test
  function or critic. `WGANInference` continues to use
  `discriminator` only to share methods and attributes with
  `GANInference`.
  
  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.WGANInference({x: x_data}, discriminator)
  ```
class_docstr_tok: ["Parameter","estimation","with","GAN-style","training","[","@","goodfellow2014generative","]",",","using","the","Wasserstein","distance","[","@","arjovsky2017wasserstein","]",".","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","Argument-wise",",","the","only","difference","from","`","GANInference","`","is","conceptual",":","the","`","discriminator","`","is","better","described","as","a","test","function","or","critic",".","`","WGANInference","`","continues","to","use","`","discriminator","`","only","to","share","methods","and","attributes","with","`","GANInference","`",".","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.WGANInference","(","{","x",":","x_data","}",",","discriminator",")","``","`"]
docstr: Initialize inference algorithm. It initializes hyperparameters
  and builds ops for the algorithm's computation graph.
  
  Args:
    penalty: float.
      Scalar value to enforce gradient penalty that ensures the
      gradients have norm equal to 1 [@gulrajani2017improved]. Set to
      None (or 0.0) if using no penalty.
    clip: float.
      Value to clip weights by. Default is no clipping.
docstr_tok: ["Initialize","inference","algorithm",".","It","initializes","hyperparameters","and","builds","ops","for","the","algorithm","'s","computation","graph",".","Args",":","penalty",":","float",".","Scalar","value","to","enforce","gradient","penalty","that","ensures","the","gradients","have","norm","equal","to","1","[","@","gulrajani2017improved","]",".","Set","to","None","(","or","0.0",")","if","using","no","penalty",".","clip",":","float",".","Value","to","clip","weights","by",".","Default","is","no","clipping","."]
code: def initialize(self, penalty=10.0, clip=None, *args, **kwargs):
      """Initialize inference algorithm. It initializes hyperparameters
      and builds ops for the algorithm's computation graph.
  
      Args:
        penalty: float.
          Scalar value to enforce gradient penalty that ensures the
          gradients have norm equal to 1 [@gulrajani2017improved]. Set to
          None (or 0.0) if using no penalty.
        clip: float.
          Value to clip weights by. Default is no clipping.
      """
      self.penalty = penalty
  
      super(WGANInference, self).initialize(*args, **kwargs)
  
      self.clip_op = None
      if clip is not None:
          var_list = tf.get_collection(
              tf.GraphKeys.TRAINABLE_VARIABLES, scope="Disc"
          )
          self.clip_op = [
              w.assign(tf.clip_by_value(w, -clip, clip))
              for w in var_list
          ]
  
file_path: edward/edward/inferences/wgan_inference.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  import tensorflow
  from edward.inferences.gan_inference import GANInference
  from edward.util import get_session
label_desc: Use image node_id 2 for calling the WGANInference obj's underlying member method code with example usage: obj.initialize(penalty, clip) without return types