socialsent icon indicating copy to clipboard operation
socialsent copied to clipboard

Symmetric transition matrix

Open slavi opened this issue 6 years ago • 0 comments

The paper claims that the transition matrix T=D^0.5*E*D^0.5 is symmetric, and socialsent.graph_construct.transition_matrix takes a sym parameter that is supposed to make the transition matrix symmetric.

That is however not the case (mathematically, the above equation does not make a non-symmetric matrix symmetric). This can be trivially demonstrated by e.g.:

    import numpy as np
    from socialsent.graph_construction import transition_matrix

    v = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
    v_norm = np.divide(v.T, np.linalg.norm(v, axis=1)).T
    E = namedtuple('Embedding', ['m'])
    embeddings = E(m=v_norm)
    M = transition_matrix(embeddings, nn=1, sym=True, arccos=True)
    print M
[[ 0.          0.97276408  0.        ]
 [ 0.          0.          1.        ]
 [ 0.          1.          0.        ]]

What am I missing?

slavi avatar Aug 03 '18 08:08 slavi