Someone use ed.SGLD


#1

hi all edward users.
someone give a example about ed.SGLD.
thanks.

x_prob = Beta(0.3, 1.0)
x = Bernoulli(probs=x_prob)

qx_prob = Empirical(params=tf.Variable(tf.zeros(10)))

inference = ed.SGLD({x_prob: qx_prob}, data={x: 1})
inference.run(n_steps=10)

samples = x_prob.sample(10).eval()
print("samples: " + str(samples))

params = qx_prob.params.eval()
print("params: " + str(params))

mean = qx_prob.mean().eval()
print("mean: " + str(mean))

it goes error!