code: def get_samples(x_ph, num_points=10000, num_bins=100):
      """Return a tuple (db, pd, pg), where
      + db is the discriminator's decision boundary;
      + pd is a histogram of samples from the data distribution;
      + pg is a histogram of samples from the generative model.
      """
      sess = ed.get_session()
      bins = np.linspace(-8, 8, num_bins)
  
      # Decision boundary
      with tf.variable_scope("Disc", reuse=True):
          p_true = tf.sigmoid(discriminative_network(x_ph))
  
      xs = np.linspace(-8, 8, num_points)
      db = np.zeros((num_points, 1))
      for i in range(num_points // FLAGS.M):
          db[FLAGS.M * i : FLAGS.M * (i + 1)] = sess.run(
              p_true,
              {
                  x_ph: np.reshape(
                      xs[FLAGS.M * i : FLAGS.M * (i + 1)], (FLAGS.M, 1)
                  )
              },
          )
  
      # Data samples
      d = next_batch(num_points)
      pd, _ = np.histogram(d, bins=bins, density=True)
  
      # Generated samples
      eps_ph = tf.placeholder(tf.float32, [FLAGS.M, 1])
      with tf.variable_scope("Gen", reuse=True):
          G = generative_network(eps_ph)
  
      epss = np.linspace(-8, 8, num_points)
      g = np.zeros((num_points, 1))
      for i in range(num_points // FLAGS.M):
          g[FLAGS.M * i : FLAGS.M * (i + 1)] = sess.run(
              G,
              {
                  eps_ph: np.reshape(
                      epss[FLAGS.M * i : FLAGS.M * (i + 1)],
                      (FLAGS.M, 1),
                  )
              },
          )
      pg, _ = np.histogram(g, bins=bins, density=True)
  
      return db, pd, pg
  
file_path: edward/examples/gan_wasserstein_synthetic.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import edward
  import matplotlib.pyplot
  import numpy
  import seaborn
  import tensorflow
  from scipy.stats import norm
label_desc: Use image node_id 4 for calling a global function with example usage: get_samples(x_ph, num_points, num_bins) and returns: db,  pd,  pg