svd.py 文件源码

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

项目:core 作者: cherab 项目源码 文件源码
def invert_svd(w_matrix, b_vector):

    # Compute the Moore-Penrose pseudo-inverse of a matrix from SVD
    inverse_w_matrix = np.matrix(linalg.pinv(w_matrix))

    # reshape b_vector into a column vector
    b_vector = b_vector.reshape((len(b_vector), 1))

    print(b_vector.shape)

    inverted_x_vector = (inverse_w_matrix * b_vector).flatten()

    return np.asarray(inverted_x_vector).flatten()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号