def hausdorff_distance(X, Y, n):
'''
distace between subspaces by Hausdorff's definition
'''
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]):
inner = inter + np.square(X[:, i].conjugate().T.dot(Y[:, j]))
distance = np.sqrt(np.max(rank(X), rank(Y)) - inner)
return distance
# distance with inner-product
评论列表
文章目录