def hmm_messages_forwards(self): alphal = HMMStatesEigen._messages_forwards_log( self.hmm_fwd_trans_matrix, self.hmm_fwd_pi_0, self.hmm_aBl) self._normalier = np.logaddexp.reduce(alphal[-1]) return alphal
def hmm_messages_forwards(self): alphal = HMMStatesEigen._messages_forwards_log( self.hmm_fwd_trans_matrix, self.hmm_fwd_pi_0, self.hmm_aBl) self._normalier = np.logaddexp.reduce(alphal[-1]) return alphal
def E_step(self): alphal = HMMStatesEigen._messages_forwards_log(self.hmm_trans_matrix, self.pi_0, self.aBl) betal = HMMStatesEigen._messages_backwards_log(self.hmm_trans_matrix, self.aBl) self.expected_states, self.expected_transcounts, self._normalizer = HMMStatesPython._expected_statistics_from_messages( self.hmm_trans_matrix, self.aBl, alphal, betal ) # using these is untested! self._expected_ns = np.diag(self.expected_transcounts).copy() self._expected_tots = self.expected_transcounts.sum(1) self.expected_transcounts.flat[:: self.expected_transcounts.shape[0] + 1] = 0.0
def E_step(self): alphal = HMMStatesEigen._messages_forwards_log(self.hmm_trans_matrix, self.pi_0, self.aBl) betal = HMMStatesEigen._messages_backwards_log(self.hmm_trans_matrix, self.aBl) self.expected_states, self.expected_transcounts, self._normalizer = \ HMMStatesPython._expected_statistics_from_messages( self.hmm_trans_matrix, self.aBl, alphal, betal) # using these is untested! self._expected_ns = np.diag(self.expected_transcounts).copy() self._expected_tots = self.expected_transcounts.sum(1) self.expected_transcounts.flat[::self.expected_transcounts.shape[0] + 1] = 0.
def hmm_messages_forwards_log(self): return HMMStatesEigen._messages_forwards_log(self.hmm_trans_matrix, self.hmm_pi_0, self.hmm_aBl)
def hmm_messages_forwards_log(self): return HMMStatesEigen._messages_forwards_log( self.hmm_trans_matrix,self.hmm_pi_0,self.hmm_aBl)