View source on GitHub 
A transformation of samples of the outer BayesianModel
.
tfp.experimental.inference_gym.targets.Model.SampleTransformation(
fn, pretty_name, ground_truth_mean=None, ground_truth_mean_standard_error=None,
ground_truth_standard_deviation=None,
ground_truth_standard_deviation_standard_error=None, dtype=tf.float32
)
Specifically, E_{x~p}[f(x)]
for a model p
and transformation f
. The
model p
is implicit, in that the SampleTransformation
appears in the
sample_transformations
field of that BayesianModel
. The f
is given as
fn
so that candidate samples may be passed through it. The fn
may close
over the parameters of p
, and the ground_truth_mean
will presumably
depend on p
implicitly via some sampling process.
If the ground_truth_mean
is estimated by sampling, then
ground_truth_standard_deviation
and ground_truth_mean_standard_error
are
related using the standard formula:
SEM = SD / sqrt(N)
where N
is the number of samples. ground_truth_standard_deviation
describes the distribution of f(x)
, while
ground_truth_mean_standard_error
desribes how accurately we know ground_truth_mean
.
Examples
An identity fn
for a vectorvalued target would look like:
fn = lambda x: x
Attributes  

fn

Function that takes samples from the target and returns a (nest of)
Tensor . The returned Tensor must retain the leading nonevent
dimensions.

pretty_name

Human readable name, suitable for a table in a paper. 
ground_truth_mean

Ground truth value of this expectation. Can be None
if not available. Default: None .

ground_truth_mean_standard_error

Standard error of the ground truth mean.
Can be None if not available. Default: None .

ground_truth_standard_deviation

Standard deviation of samples transformed
by fn . Can be None if not available. Default: None .

ground_truth_standard_deviation_standard_error

Standard error of the
ground truth standard deviation. Can be None if not available.
Default: None .

dtype

Possibly nested dtype of the output of fn . Default: tf.float32 .

Methods
__call__
__call__(
value
)
Returns fn(value)
.