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
gs_kernel.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录