Thank you, dustin. So in the case of Probabilistic PCA, I have to modify the code as below to do SGHMC inference. The syntaxe" qz=Empirical(params=tf.Variable(tf.zeros([N, N, K])))" have to include two N, both mean the number of samples？ It looks somewhat weired and the results of SGHMC looks not correct

```
N = 5000 # number of data points
D = 2 # data dimensionality
K = 1 # latent dimensionality
x_train = build_toy_dataset(N, D, K)
w = Normal(loc=tf.zeros([D, K]), scale=2.0 * tf.ones([D, K]))
z = Normal(loc=tf.zeros([N, K]), scale=tf.ones([N, K]))
x = Normal(loc=tf.matmul(w, z, transpose_b=True), scale=tf.ones([D, N]))
#For SGHMC inference
qw=Empirical(params=tf.Variable(tf.zeros([N, D, K])))
qz=Empirical(params=tf.Variable(tf.zeros([N, N, K])))
inference = ed.SGHMC({w: qw, z:qz}, data={x: x_train})
inference.run(step_size=1e-3)
#For KLqp inference
#qw = Normal(loc=tf.Variable(tf.random_normal([D, K])),
# scale=tf.nn.softplus(tf.Variable(tf.random_normal([D, K]))))
#qz = Normal(loc=tf.Variable(tf.random_normal([N, K])),
# scale=tf.nn.softplus(tf.Variable(tf.random_normal([N, K]))))
#inference = ed.KLqp({w: qw, z: qz}, data={x: x_train})
#inference.run(n_iter=500, n_print=100, n_samples=10)
w_post_mean=self.qw.mean().eval()
```