View source on GitHub |

A transformation of samples of the outer `BayesianModel`

.

```
@staticmethod
tfp.experimental.substrates.numpy.experimental.inference_gym.targets.BayesianModel.SampleTransformation(
_cls, 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
)
```

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`

.

#### Attributes:

: Function that takes samples from the target and returns a (nest of)`fn`

`Tensor`

. The returned`Tensor`

must retain the leading non-event dimensions.: Human readable name, suitable for a table in a paper.`pretty_name`

: Ground truth value of this expectation. Can be`ground_truth_mean`

`None`

if not available. Default:`None`

.: Standard error of the ground truth mean. Can be`ground_truth_mean_standard_error`

`None`

if not available. Default:`None`

.: Standard deviation of samples transformed by`ground_truth_standard_deviation`

`fn`

. Can be`None`

if not available. Default:`None`

.: Standard error of the ground truth standard deviation. Can be`ground_truth_standard_deviation_standard_error`

`None`

if not available. Default:`None`

.

#### Examples

An identity `fn`

for a vector-valued target would look like:

```
fn = lambda x: x
```

## Methods

`__call__`

```
__call__(
value
)
```

Returns `fn(value)`

.