Hi,
Quite a simple question, but could not find an answer - I am trying to draw from a gaussian shape (2,3), then index rows with one independent variable, and columns with another.
As in Ip = Ip_mu[v_i, v_h], in the following:
obs = np.random.normal(0,1, size=(20,1))
v_i = np.random.binomial(1,0.5, size=(20,1))
v_h = np.random.binomial(2,0.5, size=(20,1))
N_i = len(np.unique(v_i))
N_h = len(np.unique(v_h))
model = pm.Model()
with model:
Ip_mu = pm.Normal('Ip_mu', mu=0, sd=1, shape = (N_i, N_h))
Ip = Ip_mu[v_i, v_h]
nx = pm.Normal('nx', mu=Ip, sd = 1, observed=obs)
…/lib/python3.6/site-packages/theano/tensor/subtensor.py:2190: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)]
instead of arr[seq]
. In the future this will be interpreted as an array index, arr[np.array(seq)]
, which will result either in an error or a different result.
I get the above warning - which I do not really understand.
I am wondering if I should go about this in a different way?
Thanks
P.S. I realize the toy example doesn’t make much sense - just constructed it to clarify the question.