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
In pomegranate 1.0.0, an attempt to classify a single-element sequence using DenseHMM fails with a RuntimeError due to an illegal reshaping operation. SparseHMM works fine.
Sample code that reproduces the problem (mostly copied from the docs):
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "venv/lib/python3.11/site-packages/pomegranate/hmm/_base.py", line 518, in predict
return torch.argmax(self.predict_log_proba(X, priors=priors), dim=-1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.11/site-packages/pomegranate/hmm/_base.py", line 459, in predict_log_proba
_, r, _, _, _ = self.forward_backward(X, priors=priors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "venv/lib/python3.11/site-packages/pomegranate/hmm/dense_hmm.py", line 486, in forward_backward
t = t.reshape(n, l-1, -1)
^^^^^^^^^^^^^^^^^^^^^
RuntimeError: cannot reshape tensor of 0 elements into shape [1, 0, -1] because the unspecified dimension size -1 can be any value and is ambiguous
The text was updated successfully, but these errors were encountered:
In pomegranate 1.0.0, an attempt to classify a single-element sequence using DenseHMM fails with a RuntimeError due to an illegal reshaping operation. SparseHMM works fine.
Sample code that reproduces the problem (mostly copied from the docs):
Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: