def inference_network(x):
 with slim.arg_scope([slim.conv2d, slim.fully_connected], activation_fn=tf.nn.elu, normalizer_fn=slim.batch_norm, normalizer_params={'scale': True}):
  net = tf.reshape(x, [M, 28, 28, 1])
  net = slim.conv2d(net, 32, 5, stride=2)
  net = slim.conv2d(net, 64, 5, stride=2)
  net = slim.conv2d(net, 128, 5, padding='VALID')
  net = slim.dropout(net, 0.9)
  net = slim.flatten(net)
  params = slim.fully_connected(net, (d * 2), activation_fn=None)
 mu = params[:, :d]
 sigma = tf.nn.softplus(params[:, d:])
 return (mu, sigma)

def inference_network ( x ) : with slim . arg_scope ( [ slim . conv2d , slim . fully_connected ] , activation_fn = tf . nn . elu , normalizer_fn = slim . batch_norm , normalizer_params = { 'scale' : True } ) : net = tf . reshape ( x , [ M , 28 , 28 , 1 ] ) net = slim . conv2d ( net , 32 , 5 , stride = 2 ) net = slim . conv2d ( net , 64 , 5 , stride = 2 ) net = slim . conv2d ( net , 128 , 5 , padding = 'VALID' ) net = slim . dropout ( net , 0.9 ) net = slim . flatten ( net ) params = slim . fully_connected ( net , ( d * 2 ) , activation_fn = None ) mu = params [ : , : d ] sigma = tf . nn . softplus ( params [ : , d : ] ) return ( mu , sigma )
inference network to parameterize variational model .