Generate samples from an unnormalized distribution

moved from Generate samples from an unnormalized distribution · Issue #727 · blei-lab/edward · GitHub.

@amehrjou
How can I use implemented samplers (like HMC and Langevin) in Edward to generate samples from an arbitrary unnormalized distribution?

@dustin
If you only want to sample from an unnormalized density (e.g., not maximize parameters with respect to it), create a custom random variable (Edward – Developing Custom Random Variables) and implement _log_prob. Then pass in something like ed.HMC({x: qx}) where x is the custom random variable and qx is an empirical distribution storing its approximate samples.