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
评论列表
文章目录