Hi,
I am running into problems when I use theano.shared variables. I have simplified the problem down to a minimal example below. When I replace the ‘observed’ variable with a shared object and operate on the pymc3 distribution, I get the error listed below in the final line.
Any help would be much appreciated.
=======================
import numpy as np
import theano
floatX = theano.config.floatX
import pymc3 as pm
Xshape = (10,2)
X_train = np.random.randn(*Xshape).astype(floatX)
ann_input = theano.shared(X_train)
with pm.Model() as model:
xTrain = pm.Normal('xTrain', mu=0, sd=1.,
observed=X_train,
total_size=(Xshape))
# Build neural-network using tanh activation function
act_1 = xTrain + 1
xTrain2 = pm.Normal('xTrain2', mu=0, sd=1.,
observed=ann_input,
total_size=(Xshape))
# Build neural-network using tanh activation function
act_1 = xTrain2 + 1
=======================
TypeError: For compute_test_value, one input test value does not have the requested type.
The error when converting the test value to that variable type:
Wrong number of dimensions: expected 1, got 2 with shape (10, 2).