subspace.py 文件源码

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

项目:Matrix-Analysis 作者: kingofspace0wzz 项目源码 文件源码
def kernel_distance(X, Y, n):
    '''
    distance with inner-product
    '''
    if rank(X) != X.shape[1] & rank(Y) != Y.shape[1]:
        raise Exception('Please provide subspaces with full COLUMN rank')

    inner = 0

    for i in range(X.shape[1]):
        for j in range(Y.shape[1]):
            inter = inter + np.square(X[:, i].conjugate().T.dot(Y[:, j]))

    distance = np.sqrt(inner)


# return the dimension of the intersection of two subspaces
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号