blei-lab / edward

A probabilistic programming language in TensorFlow. Deep generative models, variational inference.
http://edwardlib.org
Other
4.83k stars 760 forks source link

Model parameters point estimate not working in API page #905

Open pswpswpsw opened 6 years ago

pswpswpsw commented 6 years ago

In the API page about model parameter inference, i.e., simply a tensorflow functionality. The code given in the API page is not working with error:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't instantiate abstract class Inference with abstract methods initialize, update

Model parameters. Model parameters are parameters in a model that we will always compute point estimates for and not be uncertain about. They are defined with tf.Variables, where the inference problem is

from edward.models import Normal

theta = tf.Variable(0.0)
x = Normal(loc=tf.ones(10) * theta, scale=1.0)

inference = ed.Inference({}, {x: x_train})