tf.contrib.bayesflow.stochastic_tensor.SampleValue

class tf.contrib.bayesflow.stochastic_tensor.SampleValue

Draw n samples along a new outer dimension.

This ValueType draws n samples from StochasticTensors run within its context, increasing the rank by one along a new outer dimension.

Example:

mu = tf.zeros((2,3))
sigma = tf.ones((2, 3))
with sg.value_type(sg.SampleValue(n=4)):
  dt = sg.DistributionTensor(
    distributions.Normal, mu=mu, sigma=sigma)
# draws 4 samples each with shape (2, 3) and concatenates
assertEqual(dt.value().get_shape(), (4, 2, 3))
doc_TensorFlow
2016-10-14 12:44:21
Comments
Leave a Comment

Please login to continue.