I am trying to write model in pymc3 and use jax and tensorflow probabilty for inference using this notebook by junpenglao.
The code for the model is as follows:
y = np.random.rand(10,1) A = np.log(np.random.rand(10,10)) m,n= np.shape(A) mc = np.shape(y) with pm.Model() as model: q = pm.Uniform('scale', 4, 5) lsd = pm.Uniform('lsd', 1, 2, shape=n) beta = [pm.Bound(pm.Laplace, lower=1, upper=10).dist('beta', mu=5.0, b=lsd[i]) for i in range(n)] mu = pmmath.logsumexp(A - beta / q, axis=0) mu = np.tile(mu, (mc,1)).T noise_sigma = pm.Bound(pm.Normal, lower=0).dist('noise_sigma', mu=0, sigma=1) y_rv = pm.MvNormal('y', mu = mu, chol = noise_sigma * np.eye(mc), shape=(m,mc), observed=y)
- I’m getting the following error when I execute the model cell.
TypeError: Unsupported dtype for TensorType: object
- This is due to
betavariable is of type
I’m also facing similar error on the last line
y_rv, where noise_sigma is of type
How to resolve these errors? Please excuse me, this is my first time using the pymc3.