Skip to content

I am very curious about the element in your proposed adjacency matrix #67

@WangHonghui123

Description

@WangHonghui123

When I see your code, why do you use the relative position to calculate the norm between two nodes in a graph under a frame, shown as follows (The related code has been bold):

def seq_to_graph(seq_,seq_rel,norm_lap_matr = True):
seq_ = seq_.squeeze()
seq_rel = seq_rel.squeeze()
seq_len = seq_.shape[2]
max_nodes = seq_.shape[0]
V = np.zeros((seq_len,max_nodes,2))
A = np.zeros((seq_len,max_nodes,max_nodes))
for s in range(seq_len):
step_ = seq_[:,:,s]
step_rel = seq_rel[:,:,s]
for h in range(len(step_)):
V[s,h,:] = step_rel[h]
A[s,h,h] = 1
for k in range(h+1,len(step_)):
l2_norm = anorm(step_rel[h],step_rel[k])
A[s,h,k] = l2_norm
A[s,k,h] = l2_norm
if norm_lap_matr:
G = nx.from_numpy_matrix(A[s,:,:])
A[s,:,:] = nx.normalized_laplacian_matrix(G).toarray()
return torch.from_numpy(V).type(torch.float),
torch.from_numpy(A).type(torch.float)

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