Skip to content

Instantly share code, notes, and snippets.

@tuananhle7
Last active January 21, 2020 00:41
Show Gist options
  • Save tuananhle7/8fb6f297b121d16307462f83e31d314a to your computer and use it in GitHub Desktop.
Save tuananhle7/8fb6f297b121d16307462f83e31d314a to your computer and use it in GitHub Desktop.
import pyro
import pyro.poutine as poutine
def model(z):
pyro.sample('z', pyro.distributions.Normal(0, 1), obs=z)
z = 1.2
# this evaluates log Normal(1.2 | 0, 1)
trace = poutine.trace(model).get_trace(z)
trace.log_prob_sum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment