Apparently theano.shared
does not work with pm.gp.Latent.prior
for testval either. I tried to do the “using hold-out testing values” approach as suggested in the FAQ.
I’d like to do something like
J_init = theano.shared(np.zeros(n_coords))
gp = pm.gp.Latent(cov_func=cov)
J = gp.prior('J', X, testval=J_init)
I get the error
pymc3/distributions/distribution.py in default(self)
60
61 def default(self):
---> 62 return np.asarray(self.get_test_val(self.testval, self.defaults), self.dtype)
numpy/core/numeric.py in asarray(a, dtype, order)
--> 531 return array(a, dtype, copy=False, order=order)
532
533
ValueError: setting an array element with a sequence.
because a = <TensorType(float64, vector)>