Skip to content

building symmetric adjacency matrix in utils #84

@marigoold

Description

@marigoold

def build_symmetric_adj(adj, self_loop=True):
adj = adj + adj.T.multiply(adj.T > adj) - adj.multiply(adj.T > adj)
if self_loop:
adj = adj + sp.eye(adj.shape[0])
return adj

The original adjacency matrix built from faiss is not symmetric, so what is the purpose to convert it to symmetric matrix? And why do you implement it in this way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions