Skip to content
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

Vector multiplication error #14

Open
MFernandezCarmona opened this issue Jun 1, 2018 · 2 comments
Open

Vector multiplication error #14

MFernandezCarmona opened this issue Jun 1, 2018 · 2 comments

Comments

@MFernandezCarmona
Copy link

Hi,
I'm using the deb package available in Ubuntu 16.04. I'm experiencing this error with PyBayes:

File "/home/manolofc/catkin_ws/src/RFID/pr_model/scripts/frequencyModel.py", line 151, in addObservation
    self.pf.bayes(yt)
  File "/usr/local/lib/python2.7/dist-packages/pybayes/filters.py", line 322, in bayes
    self.emp.weights[i] *= exp(self.p_yt_xt.eval_log(yt, self.emp.particles[i]))
  File "/usr/local/lib/python2.7/dist-packages/pybayes/pdfs.py", line 1300, in eval_log
    return self.gauss.eval_log(x)
  File "/usr/local/lib/python2.7/dist-packages/pybayes/pdfs.py", line 568, in eval_log
    log_val = -1/2. * np.dot_vv(distance, np.dot_mv(linalg.inv(self.R), distance))
ValueError: shapes (2,) and (1,2) not aligned: 2 (dim 0) != 1 (dim 0)

It seems to be related with the observation and state dimensions. In my case yt has dimension 2 and xt dimension 3. Any idea of what could be wrong?
Thanks

@strohel
Copy link
Owner

strohel commented Jun 2, 2018

Hmm, seems to be a mismatch somewhere between a vector (1D array) and 1-row matrix (2D array). Can you print shape of yt at RFID/pr_model/scripts/frequencyModel.py", line 151, in addObservation?

@MFernandezCarmona
Copy link
Author

Hi,
yt.shape is (2,) . I tried to reshape it to (2,1) [1-row matrix] and I saw what you meant: library needs vectors as inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants