Returns get_attr_fn(distribution)
when vertexes
take on values
.
tfp.experimental.lazybones.utils.distribution_measure(
vertexes, values, get_attr_fn, combine, reduce_op=(lambda x: x)
)
Args |
vertexes
|
A nest structrue of lazybones deferred random variable. Usually
this is a value representation (e.g., a random sample, the mean) of a
Deferred wrapped distribution-like object.
|
values
|
A nest structrue of Array.
|
get_attr_fn
|
Callable to get a Class attribute from a distribution-like
object that used to evaluate on the vertexes itself (e.g., logpdf or
pdf from a scipy.stats distributions).
|
combine
|
Method to combine the distribution measure (e.g., sum to combine
logpdf , prod to combine pdf ).
|
reduce_op
|
Optional computation to reduce the distribution measure for each
vertexes, default to identity.
|