Open rpgoldman opened 3 years ago
Sorry: previous comment was wrong -- actually the use of pm.Data
fails for mixture models also. I'm killing that comment, but leaving this here as explanation.
(full code will be supplied as attachment -- but this may have an obvious answer.)
Did you forget to attach the code?
I'm not too familiar with the 3.11.2 implementation, but when working on shape stuff for v4 I ran into problems with broadcasting of column vectors.
The difference between the numpy array and pm.Data could be a different order of applying Ops such as as_tensor_variable
, make_vector
etc. In the end this can lead to differences in the .broadcastable
attribute of the TensorVariables, making them (in)compatible with broadcasting operations.
If you do a theano.printing.debugprint(theta)
with/without pm.Data
for alpha
you probably get differences in the graph that could explain the dimension problems.
@rpgoldman can you check your model again with a recent version? I would suspect that the issue has been resolved in the meantime
Description of your problem
I have a model that compiles correctly when the priors are represented as numpy arrays, but that gets a shape error when those numpy arrays are wrapped in
pm.Data
, which seems wrong (isn't it?).Example code
(full code will be supplied as attachment -- but this may have an obvious answer.)
When the above piece of code is executed as written, it completes successfully.
However, if I replace the definitions of
alpha
andbeta_prior
with the commented out lines usingpm.Data
, I get shape errors. Traceback follows:Versions and main components