TensorFlow 2.0 Beta is available Learn more

tfp.edward2.Empirical

Create a random variable for Empirical.

tfp.edward2.Empirical(
    *args,
    **kwargs
)

Defined in python/edward2/interceptor.py.

See Empirical for more details.

Returns:

RandomVariable.

Original Docstring for Distribution

Initialize Empirical distributions.

Args:

  • samples: Numeric Tensor of shape [B1, ..., Bk, S, E1, ..., En],k, n >= 0. Samples or batches of samples on which the distribution is based. The firstkdimensions index into a batch of independent distributions. Length ofSdimension determines number of samples in each multiset. The lastn` dimension represents samples for each distribution. n is specified by argument event_ndims.
  • event_ndims: Python int32, default 0. number of dimensions for each event. When 0 this distribution has scalar samples. When 1 this distribution has vector-like samples.
  • validate_args: Python bool, default False. When True distribution parameters are checked for validity despite possibly degrading runtime performance. When False invalid inputs may silently render incorrect outputs.
  • allow_nan_stats: Python bool, default True. When True, statistics (e.g., mean, mode, variance) use the value NaN to indicate the result is undefined. When False, an exception is raised if one or more of the statistic's batch members are undefined.
  • name: Python str name prefixed to Ops created by this class.

Raises:

  • ValueError: if the rank of samples < event_ndims + 1.