tf.contrib.bayesflow.monte_carlo.expectation(f, p, z=None, n=None, seed=None, name='expectation')
Monte Carlo estimate of an expectation: E_p[f(Z)] with sample mean.
This Op returns
n^{-1} sum_{i=1}^n f(z_i), where z_i ~ p
\approx E_p[f(Z)]
User supplies either Tensor of samples z, or number of samples to draw n
Args:
f: Callable mapping samples from p to Tensors.
p: tf.contrib.distributions.BaseDistribution.
z: Tensor of samples from p, produced by p.sample_n.
n: Integer Tensor. Number