-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GuassianRandomWalk fails for 2D shape #4010
Comments
@lucianopaz is there any update on this? |
@Rish001 Do you want to do a PR on this? |
Yeah I do but I have to understand what incorrect assumption is current |
I suspect the source of bug to be these lines - This helper method chops off an array from first dimension, because we want the noise from Gaussian steps to contribute to (n-1) timesteps. Coming to the I see two possible solutions
This same issue popped out in #4388, during logp computations of MvGaussianRandomWalk with 2 dimensional inputs. An ideal solution for me will be to have an abstract @Rish001 Want to do a PR? |
Yeah sure. Let me see if what you said works
Thanks and regards
Rishav Dutta
Phone: 8910550956
mail to: [email protected]
বৃহস্, 31 ডিসে., 2020 14:32 তারিখে Sayam Kumar <[email protected]>
লিখেছেন:
… I suspect the source of bug to be these lines -
https://github.com/pymc-devs/pymc3/blob/91993d880d3e40bb81f2a06402940fde20af555f/pymc3/distributions/timeseries.py#L223-L224
This helper method chops off an array from first dimension, because we
want the noise from Gaussian steps to contribute to (n-1) timesteps. Coming
to the logp method, a (3, 4) shaped tensor is passed in and asked to
compute logp from Normal distribution with mean of shape 3.
And broadcasting fails for tensors (3, 4) and (3).
I see two possible solutions
- Broadcast mu and sigma beforehand to core distribution shape.
- Chop off the first array iff the number of dimensions in mu and sigma
are equal to those in distribution shape. Let theano take care of
broadcasting semantics for us.
This same issue popped out in #4388
<#4388>, during logp computations
of MvGaussianRandomWalk with 2 dimensional inputs.
An ideal solution for me will be to have an abstract RandomWalk class
that takes care of shape handling for us. Then we inherit this class, and
only change init and noise distributions. With this, any PyMC3
distribution can be used for Random Walk. Thoughts on this?
@Rish001 <https://github.com/Rish001> Want to do a PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4010 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBQMCWJQ5TVJ3ZJ2JC4ZZLSXQ43FANCNFSM4OXZYOQQ>
.
|
Tracking #5298 |
Closed via #5298 |
Description of your problem
Please provide a minimal, self-contained, and reproducible example.
When
shape
is introduced in the form of(3,4,),
I am getting an error messageValueError: Input dimension mis-match. (input[0].shape[1] = 4, input[1].shape[1] = 3)
for the linegrw1 = pymc3.GaussianRandomWalk('grw1', mu=numpy.arange(4), shape=(3,4,))
Please provide the full traceback.
Please provide any additional information below.
As discussed in #3985 , It looks like
logp
made some incorrect assumptions on the shape ofmu
andsigma
The text was updated successfully, but these errors were encountered: