Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
fixed MSM coarse-graining
Browse files Browse the repository at this point in the history
  • Loading branch information
franknoe authored and marscher committed Feb 18, 2016
1 parent ff0c55b commit 82dd713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pyemma/msm/estimators/maximum_likelihood_hmsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def _estimate(self, dtrajs):

# INIT HMM
from bhmm import init_discrete_hmm
from pyemma.msm.estimators import MaximumLikelihoodMSM
if self.msm_init=='largest-strong':
hmm_init = init_discrete_hmm(dtrajs_lagged_strided, self.nstates, lag=1,
reversible=self.reversible, stationary=True, regularize=True,
Expand All @@ -208,7 +209,7 @@ def _estimate(self, dtrajs):
hmm_init = init_discrete_hmm(dtrajs_lagged_strided, self.nstates, lag=1,
reversible=self.reversible, stationary=True, regularize=True,
method='spectral', separate=self.separate)
elif issubclass(self.msm_init.__class__, MaximumLikelihoodHMSM): # initial MSM given.
elif issubclass(self.msm_init.__class__, MaximumLikelihoodMSM): # initial MSM given.
from bhmm.init.discrete import init_discrete_hmm_spectral
p0, P0, pobs0 = init_discrete_hmm_spectral(self.msm_init.count_matrix_full, self.nstates,
reversible=self.reversible, stationary=True,
Expand Down
2 changes: 1 addition & 1 deletion pyemma/msm/estimators/maximum_likelihood_msm.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def hmm(self, nhidden):
# if hmm.nstates = msm.nstates there is no problem. Otherwise, check spectral gap
if self.nstates > nhidden:
timescale_ratios = self.timescales()[:-1] / self.timescales()[1:]
if timescale_ratios[self.nstates-2] < 1.5:
if timescale_ratios[nhidden-2] < 1.5:
self.logger.warning('Requested coarse-grained model with ' + str(nhidden) + ' metastable states at ' +
'lag=' + str(self.lag) + '.' + 'The ratio of relaxation timescales between ' +
str(nhidden) + ' and ' + str(nhidden+1) + ' states is only ' +
Expand Down

0 comments on commit 82dd713

Please sign in to comment.