gs_kernel.py 文件源码

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

项目:microbiome-summer-school-2017 作者: aldro61 项目源码 文件源码
def compute_P(max_string_length, sigma_position):
    """
    P is a matrix that contains all possible position
    uncertainty values. This function pre-compute all
    possible values since those values are independant of
    the amino acids sequence. 
    """

    P = np.zeros((max_string_length, max_string_length))

    for i in xrange(max_string_length):
        for j in xrange(max_string_length):
            P[i,j] = i-j

    P = np.square(P)
    P /= -2.0 * (sigma_position ** 2.0)
    P = np.exp(P)

    return P
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号