replay.py 文件源码

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

项目:nelpy 作者: nelpy 项目源码 文件源码
def score_hmm_logprob(bst, hmm, normalize=False):
    """Score events in a BinnedSpikeTrainArray by computing the log
    probability under the model.

    Parameters
    ----------
    bst : BinnedSpikeTrainArray
    hmm : PoissonHMM
    normalize : bool, optional. Default is False.
        If True, log probabilities will be normalized by their sequence
        lengths.
    Returns
    -------
    logprob : array of size (n_events,)
        Log probabilities, one for each event in bst.
    """

    logprob = np.atleast_1d(hmm.score(bst))
    if normalize:
        logprob = np.atleast_1d(logprob) / bst.lengths

    return logprob
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号