mattjj / pyhsmm

MIT License
546 stars 173 forks source link

About hsmm-possiblechangepoints.py #49

Closed hang-wu closed 9 years ago

hang-wu commented 9 years ago

Hi Matthew,

Thanks a lot for your awesome codes. However, when I try to run examples/ hsmm-possiblechangepoints.py, I encountered some issues.

  1. In line 38, truemodel.plot(), the 'DiagonalGaussian' object has no attribute 'plotting_subspace_basis'
  2. In line 65, pyhsmm.models.DiagGaussGMMHSMMPossibleChangepointsSeparateTrans seems not implemented.

I am wondering why this happened. I am using a MAC OSX, with python version Python 2.7.8 (default, Oct 18 2014, 19:36:29) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin

Thanks again. Best

mattjj commented 9 years ago

(I forgot about this one!)

I'm glad you like the code!

The observation-specific special model DiagGaussGMMHSMMPossibleChangepointsSeparateTrans would only need to be implemented if there were some specialized low-level code for that combination of observations and model features. (In the past I've wanted extra-fast inference for some specialized models, hence those bespoke classes.) You probably just want an HSMMPossibleChangepointsSeparateTrans as your model (if it exists, it should just be a combination of mixins), and pass in a list of DiagonalGaussian instances as the obs_distns.

The plotting code is not very general or polished and pretty much only works for the examples and animations I've made, which usually just use Gaussian emissions. You'll have to write your own plotting code for the most part.