dattalab / pyhsmm-library-models

library models built on top of pyhsmm
0 stars 1 forks source link

Nmaxsuper=1 doesn't work #38

Closed alexbw closed 11 years ago

alexbw commented 11 years ago
○ python real_data_plots/parallel-library-subhmms.py
Traceback (most recent call last):
  File "real_data_plots/parallel-library-subhmms.py", line 60, in <module>
    dur_distns=dur_distns)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/models.py", line 626, in __init__
    obs_distns=self.HMMs,**kwargs)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/models.py", line 434, in __init__
    super(HSMM,self).__init__(**kwargs)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/models.py", line 46, in __init__
    gamma_a_0=gamma_a_0,gamma_b_0=gamma_b_0)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/internals/transitions.py", line 386, in __init__
    **kwargs)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/internals/transitions.py", line 345, in __init__
    self.resample()
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/internals/transitions.py", line 389, in resample
    super(HDPHSMMTransitionsConcResampling,self).resample(*args,**kwargs)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/internals/transitions.py", line 358, in resample
    self._resample_A(augmented_data)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/internals/transitions.py", line 371, in _resample_A
    super(HDPHSMMTransitions,self)._resample_A(augmented_data)
  File "/home/abw11/Code/pyhsmm_library_models/pyhsmm/internals/transitions.py", line 74, in _resample_A
    self.A /= self.A.sum(1)[:,na]
AttributeError: 'float' object has no attribute 'sum'
mattjj commented 11 years ago

This is kind of a tricky one, and it exists for all my HMM and HSMM model code ever: if Nmax=1, there's only one state and it's really a single-observation-distribution model. More importantly, matrices turn into scalars at various parts of the code. It could be fixed with some diligent application of np.atleast_2d and the like.

I think this is the first possible reason to do that: it would let us easily train a single-subHMM model as a sanity check.

But it's not a very strong reason, so I think this is a low priority. I'm going to apply the wontfix label because it's passive aggressive and I've always wanted to do that.

EDIT: single-state models would be whatever a single observation distribution is (not necessarily a mixture model, that'd only be the case for our HSMMs over GMMs).

alexbw commented 11 years ago

Gotcha, sounds fine to me.

On Wed, Oct 30, 2013 at 2:31 PM, Matthew Johnson notifications@github.comwrote:

This is kind of a tricky one, and it exists for all my HMM and HSMM model code ever: if Nmax=1, there's only one state and it's really a mixture model. More importantly, matrices turn into scalars at various parts of the code. It could be fixed with some diligent application of np.atleast_2dand the like.

I think this is the first possible reason to do that: it would let us easily train a single-subHMM model as a sanity check.

But it's not a very strong reason, so I think this is a low priority. I'm going to apply the wontfix label because it's passive aggressive and I've always wanted to do that.

— Reply to this email directly or view it on GitHubhttps://github.com/dattalab/pyhsmm-library-models/issues/38#issuecomment-27423993 .

alexbw commented 11 years ago

Should we just close it? We still have a record of it, even if closed.