src/core/util.py
def grassmann(A, B):
    '''
    Computes the Grassmann distance between matrices A and B

    A, B:       input matrices

    returns:    the grassmann distance between A and B
    '''
    M = np.dot(np.transpose(A), B)
    _, s, _ = np.linalg.svd(M, full_matrices=False)
    s = 1 - np.square(s)
    grassmann = np.sum(s)
    return grassmann

    Computes the Grassmann distance between matrices A and B

    A, B:       input matrices

    returns:    the grassmann distance between A and B
    
Computes the Grassmann distance between matrices A and B
A, B:       input matrices

the grassmann distance between A and B
Computes the Grassmann distance between matrices A and B A B : input matrices the grassmann distance between A and B
def grassmann(A, B):
    M = np.dot(np.transpose(A), B)
    _, s, _ = np.linalg.svd(M, full_matrices=False)
    s = 1 - np.square(s)
    grassmann = np.sum(s)
    return grassmann
def grassmann ( A , B ) : M = np . dot ( np . transpose ( A ) , B ) _ , s , _ = np . linalg . svd ( M , full_matrices = False ) s = 1 - np . square ( s ) grassmann = np . sum ( s ) return grassmann
Computes the Grassmann distance between matrices A and B
A, B:       input matrices
Computes the Grassmann distance between matrices A and B A B : input matrices
'''
    Computes the Grassmann distance between matrices A and B

    A, B:       input matrices

    returns:    the grassmann distance between A and B
    '''
A
B