Hi, dustin.

I’m trying to implement Gaussian Matrix Factorization (aka Probabilistic Matrix Factorization, PMF)[1] in Edward.

My question is how to handle missing value as “missing value”.

The PMF uses indicator function to distinguish the rating value y_ij observed or not in Eq (1) of [1], but my current implementation (please see bottom) treats the missing value as zero (not missing), so the predicted rating value highly biased towards zero.

Is there any good practice for it?

Or do I need to implement PMF specific variational method?

Thanks.

```
N = 10
M = 10
K = 5 # latent dimension
y_train = np.random.randint(low=0, high=5, size=(M, N))
U = Normal(mu=tf.zeros([M, K]), sigma=tf.ones([M, K]))
V = Normal(mu=tf.zeros([N, K]), sigma=tf.ones([N, K]))
Y = Normal(mu=tf.matmul(U, V, transpose_b=True), sigma=tf.ones([M, N]))
qU = Normal(
mu=tf.Variable(tf.random_uniform([M, K])),
sigma=tf.Variable(tf.nn.softplus(tf.random_uniform([M, K])))
)
qV = Normal(
mu=tf.Variable(tf.random_uniform([N, K])),
sigma=tf.Variable(tf.nn.softplus(tf.random_uniform([N, K])))
)
inference = ed.KLqp({U: qU, V: qV}, data={Y: y_train})
inference.run(n_iter=1000)
```

[1] Salakhutdinov, R., & Mnih, A. (2007). Probabilistic Matrix Factorization. In Proc of NIPS