You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working in #5690, I realized we have a bug when doing the following:
importpymcaspmx=pm.GaussianRandomWalk.dist(init=pm.Normal.dist(), steps=5, shape=(3, ...))
print(x.shape.eval()) # [3, 3, 6]; should be [3, 6]print(x.eval()) # ValueError
This happens because we have to resize init to be of the same size of x, as the GaussianRandomWalk (GRW) is a composite distribution of init + innovations. We do this in dist, and I simply did not consider that shape could have an ellipsis.
In general, this sort of issue will be prevalent in most "composite" distributions, such as LKJCorr, Censored, Mixture, and so on, where we need to resize some of the the dist arguments to match size, shape, dims or else ask users to to it themselves. We can make things quite simpler for us if we don't allow the ellipsis or shape argument into the dist classmethod, as we will only have to worry about size in that case.
The text was updated successfully, but these errors were encountered:
ricardoV94
changed the title
Reconsider allowing shape/ellipsis in dist classmethods
Reconsider not allowing shape/ellipsis in dist classmethods
Apr 8, 2022
When working in #5690, I realized we have a bug when doing the following:
This happens because we have to resize
init
to be of the same size ofx
, as the GaussianRandomWalk (GRW) is a composite distribution ofinit
+innovations
. We do this indist
, and I simply did not consider that shape could have an ellipsis.In general, this sort of issue will be prevalent in most "composite" distributions, such as
LKJCorr
,Censored
,Mixture
, and so on, where we need to resize some of the thedist
arguments to matchsize, shape, dims
or else ask users to to it themselves. We can make things quite simpler for us if we don't allow the ellipsis or shape argument into thedist
classmethod, as we will only have to worry aboutsize
in that case.The text was updated successfully, but these errors were encountered: