Generate samples from an unnormalized distribution


#1

moved from https://github.com/blei-lab/edward/issues/727.

@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 (http://edwardlib.org/api/model-development) 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.