code: def gamma_q(shape, name=None):
      # Parameterize Gamma q's via shape and scale, with softplus unconstraints.
      with tf.variable_scope(name, default_name="gamma_q"):
          min_shape = 1e-3
          min_scale = 1e-5
          shape = tf.get_variable(
              "shape",
              shape,
              initializer=tf.random_normal_initializer(
                  mean=0.5, stddev=0.1
              ),
          )
          scale = tf.get_variable(
              "scale",
              shape,
              initializer=tf.random_normal_initializer(stddev=0.1),
          )
          rv = Gamma(
              tf.maximum(tf.nn.softplus(shape), min_shape),
              tf.maximum(1.0 / tf.nn.softplus(scale), 1.0 / min_scale),
          )
          return rv
  
file_path: edward/examples/deep_exponential_family.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import os
  import tensorflow
  from datetime import datetime
  from edward.models import Gamma, Poisson, Normal, PointMass, TransformedDistribution
  from edward.util import Progbar
  from observations import nips
label_desc: Use image node_id 2 for calling a global function with example usage: gamma_q(shape, name) and returns: rv