Generate samples from an unnormalized distribution

moved from

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

If you only want to sample from an unnormalized density (e.g., not maximize parameters with respect to it), create a custom random variable ( 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.