def factor(X, rho):
"""
computes cholesky factorization of the kernel K = 1/rho*XX^T + I
Input:
X design matrix: n_s x n_f (we assume n_s << n_f)
rho: regularizaer
Output:
L lower triangular matrix
U upper triangular matrix
"""
n_s, n_f = X.shape
K = 1 / rho * scipy.dot(X, X.T) + scipy.eye(n_s)
U = linalg.cholesky(K)
return U
评论列表
文章目录