code: def main(_):
      ed.set_seed(42)
  
      # DATA
      x_data = build_toy_dataset(FLAGS.N, FLAGS.V)
  
      # MODEL
      x_ph = tf.placeholder(tf.float32, [FLAGS.N, FLAGS.V])
  
      # Form (N, V, V) covariance, one matrix per data point.
      K = tf.stack(
          [
              rbf(tf.reshape(xn, [FLAGS.V, 1])) + tf.diag([1e-6, 1e-6])
              for xn in tf.unstack(x_ph)
          ]
      )
      f = MultivariateNormalTriL(
          loc=tf.zeros([FLAGS.N, FLAGS.V]), scale_tril=tf.cholesky(K)
      )
      x = Poisson(rate=tf.exp(f))
  
      # INFERENCE
      qf = Normal(
          loc=tf.get_variable("qf/loc", [FLAGS.N, FLAGS.V]),
          scale=tf.nn.softplus(
              tf.get_variable("qf/scale", [FLAGS.N, FLAGS.V])
          ),
      )
  
      inference = ed.KLqp({f: qf}, data={x: x_data, x_ph: x_data})
      inference.run(n_iter=5000)
  
file_path: edward/examples/cox_process.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import tensorflow
  from edward.models import MultivariateNormalTriL, Normal, Poisson
  from edward.util import rbf
  from scipy.stats import multivariate_normal, poisson
label_desc: Use image node_id 2 for calling a global function with example usage: main(_) without return types