Closed zqwei closed 6 years ago
Can you please try installing pylds from source? I.e. git clone
the repository then, from the cloned directory, run pip install -e .
? I believe the version on pypi is a bit out of date.
Yes I install pylds and pyhsmm-autoregressive from GitHub.
The new bug (zero division error) looks like this
Fitting with VBEM
................/lib/python2.7/site-packages/pyhsmm/internals/hmm_states.py:675: RuntimeWarning: divide by zero encountered in log
np.log(trans_potential),likelihood_log_potential,alphal,betal,
pyslds/pyslds/states.py:594: RuntimeWarning: divide by zero encountered in log
params = (np.log(self.trans_matrix), np.log(self.pi_0), aBl, self._normalizer)
Traceback (most recent call last):
File "pyslds/examples/simple_demo.py", line 95, in <module>
vbem_lls = [update(test_model) for _ in progprint_xrange(N_vbem_iters)]
File "pyslds/examples/simple_demo.py", line 91, in update
model.VBEM_step()
File "pyslds/pyslds/models.py", line 217, in VBEM_step
self._vb_E_step()
File "pyslds/pyslds/models.py", line 170, in _vb_E_step
state.vb_E_step()
File "pyslds/pyslds/states.py", line 586, in vb_E_step
H_z = self.vb_E_step_discrete_states()
File "pyslds/pyslds/states.py", line 595, in vb_E_step_discrete_states
return hmm_entropy(params, self.all_expected_stats)
File "pyslds/pyslds/util.py", line 63, in hmm_entropy
neg_entropy += np.sum(sum_E_ztztp1T * log_transmatrix)
FloatingPointError: invalid value encountered in multiply
There is an error in the code, where the data is of shape (T-1) x m (m is the latent dimension) and x0 and Q0 should be add into the data.
Assertion error is reported at pylds/lds_messages_interface.py
The detailed report is as follow: