@fritzo, I am looking to do probabilistic modeling of factor graphs, in particular the various chapters in the book Model-based Machine Learning. So consider the following factor graph:
How would I use Pyro to model this? The multiplication being the issue: I assume that the joint probability is (latent variables are weight and score. Observed value is featureValue):
p(score, featureValue, weight) = p(weight) * p(featureValue) * p(score | featureValue, weight)
= p(weight) * p(featureValue) * delta(pscore - featureValues*weight)
I am fixing to try for the model:
w = pyro.sample("weight", dist.sample(Normal(0.,1.))
f = pyro.sample("feature", dist.sample(Normal(0.,1.), obs=featureValues)
s = pyro.sample("score", dist.sample(Delta(?????)))
Question: what should "s" be? How to deal with a deterministic factor.
Here is another question that has come up in relation to this:
What is the difference between:
1) pyro.sample("z", dist.Delta(5.))
2) pyro.sample("z", dist.Normal(0.,1.), obs=5.)
In both cases, the result is 5. Why can't Delta be used for observations? Thanks.