Skip to content

Vector multiplication error #14

Open

Description

@MFernandezCarmona

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

Activity

  1. strohel commented on Jun 2, 2018

    @strohel
    Owner

    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?

  2. MFernandezCarmona commented on Jun 4, 2018

    @MFernandezCarmona
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions