hsmm_states.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:siHMM 作者: Ardavans 项目源码 文件源码
def _expected_durations(self,
            dur_potentials,cumulative_obs_potentials,
            alphastarl,betal,normalizer):
        if self.trunc is not None:
            raise NotImplementedError, "_expected_durations can't handle trunc"
        T = self.T
        logpmfs = -np.inf*np.ones_like(alphastarl)
        errs = np.seterr(invalid='ignore')
        for t in xrange(T):
            cB, offset = cumulative_obs_potentials(t)
            np.logaddexp(dur_potentials(t) + alphastarl[t] + betal[t:] +
                    cB - (normalizer + offset),
                    logpmfs[:T-t], out=logpmfs[:T-t])
        np.seterr(**errs)
        expected_durations = np.exp(logpmfs.T)

        return expected_durations


# TODO call this 'time homog'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号