![]() |
Computes p.log_prob(x) - q.log_prob(y)
, numerically stably.
tfp.experimental.distributions.log_prob_ratio(
p, x, q, y
)
Args | |
---|---|
p
|
A distribution instance. |
x
|
A tensor from the support of p .
|
q
|
A distribution instance in the same family as p , with matching shape.
|
y
|
A tensor from the support of q .
|
Returns | |
---|---|
lp_ratio
|
log (p(x) / q(y)) = p.log_prob(x) - q.log_prob(y) . In some cases
this will be computed with better than naive numerical precision, e.g. by
moving the difference inside of a sum reduction.
|