I'm using a Dirichlet Process Mixture Model (DPMM) to infer cluster assignments and cluster parameters on a synthetic dataset using Edward based on the following community post. I'm using GPU-accelerated Metropolis Hastings to learn the posterior distribution over model parameters. For example, for cluster means, we have:
D = 2 #dimension of the data
K = 5 #cluster truncation
T = 10000 #number of samples
mu = Normal(loc=tf.zeros(D), scale=tf.ones(D), sample_shape=K)
qmu = Normal(loc=tf.zeros(D), scale=tf.ones(D), sample_shape=K) #posterior
gmu = Normal(loc=tf.zeros(D), scale=tf.ones(D), sample_shape=K) #proposal
inference = ed.MetropolisHastings(
latent_vars={mu: qmu, ...},
proposal_vars={mu: gmu, ...},
data={x: x_data})
I'm interested in generating a trace-plot to visualize samples from the posterior distribution qmu
. I'm looking for something similar to PyMC pm.traceplot()
How do I generate a trace plot in Edward?