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
I have an HMM that I trained and tested on some joint data. I'm trying now to sample from the HMM to simulate data and test some further analyses. However, every time I run hmm.sample(timebins) with my model, I get this error:
originalstates, sampledobs = trainedhmm.sample(timebins)
t:\updatedssm\ssm\ssm\observations.py:491: RuntimeWarning: divide by zero encountered in true_divide
sqrt_Sigma = np.linalg.cholesky(Sigmas[z] / tau) if with_noise else 0
Traceback (most recent call last):
File "", line 1, in
originalstates, sampledobs = trainedhmm.sample(timebins)
File "t:\updatedssm\ssm\ssm\hmm.py", line 221, in sample
data[0] = self.observations.sample_x(z[0], data[:0], input=input[0], with_noise=with_noise)
File "t:\updatedssm\ssm\ssm\observations.py", line 491, in sample_x
sqrt_Sigma = np.linalg.cholesky(Sigmas[z] / tau) if with_noise else 0
File "C:\ProgramData\Anaconda3\lib\site-packages\autograd\tracer.py", line 48, in f_wrapped
return f_raw(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 759, in cholesky
r = gufunc(a, signature=signature, extobj=extobj)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 100, in _raise_linalgerror_nonposdef
raise LinAlgError("Matrix is not positive definite")
LinAlgError: Matrix is not positive definite
When I create a new HMM from scratch using the same K and D values, I don't get this error. So it seems like something is going wrong with my trained HMM but I'm not sure what it could be, since the trained HMM works fine for other functions like getting the LL or predicting states on new observations. Not sure if this is a bug or something I'm doing wrong on my end.
Any advice you could give would be greatly appreciated!!
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I have an HMM that I trained and tested on some joint data. I'm trying now to sample from the HMM to simulate data and test some further analyses. However, every time I run hmm.sample(timebins) with my model, I get this error:
originalstates, sampledobs = trainedhmm.sample(timebins)
t:\updatedssm\ssm\ssm\observations.py:491: RuntimeWarning: divide by zero encountered in true_divide
sqrt_Sigma = np.linalg.cholesky(Sigmas[z] / tau) if with_noise else 0
Traceback (most recent call last):
File "", line 1, in
originalstates, sampledobs = trainedhmm.sample(timebins)
File "t:\updatedssm\ssm\ssm\hmm.py", line 221, in sample
data[0] = self.observations.sample_x(z[0], data[:0], input=input[0], with_noise=with_noise)
File "t:\updatedssm\ssm\ssm\observations.py", line 491, in sample_x
sqrt_Sigma = np.linalg.cholesky(Sigmas[z] / tau) if with_noise else 0
File "C:\ProgramData\Anaconda3\lib\site-packages\autograd\tracer.py", line 48, in f_wrapped
return f_raw(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 759, in cholesky
r = gufunc(a, signature=signature, extobj=extobj)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\linalg\linalg.py", line 100, in _raise_linalgerror_nonposdef
raise LinAlgError("Matrix is not positive definite")
LinAlgError: Matrix is not positive definite
When I create a new HMM from scratch using the same K and D values, I don't get this error. So it seems like something is going wrong with my trained HMM but I'm not sure what it could be, since the trained HMM works fine for other functions like getting the LL or predicting states on new observations. Not sure if this is a bug or something I'm doing wrong on my end.
Any advice you could give would be greatly appreciated!!
Thanks!
The text was updated successfully, but these errors were encountered: