'tag of current node'?
mmpust opened this issue · 2 comments
Hi,
many thanks for the PyTorch implementation of the DGCNN.
Do you have a python implementation (instead of the Matlab script) to generate the input text file from the individual text files (_graph_labels.txt, _graph_indicator.txt, _A.txt)? I am not familiar with Matlab. What is this following line in the script doing? What is the equivalent in python code?
A = spones(sparse(edges(:,1), edges(:,2), edge_attr(:,1), num_nodes, num_nodes))
Also, what do you mean by 'tag of current node'? Why are there for example 14 rows with 'node tag'=2 but different number of neigbors in the following example of yours?
188 # total number of graphs
23 2 # number of nodes in the first graph (23), graph label of first graph (2)
2 2 1 13 # tag of current node (2), number of neighbors (2), index first neighbor (1), index second neighbor (13)
2 2 0 2
2 3 1 3 11
2 2 2 4
2 2 3 5
2 3 4 6 10
2 3 5 7 20
2 2 6 8
2 2 7 9
2 3 8 10 15
2 3 5 9 11
2 3 2 10 12
2 3 11 13 14
2 2 0 12
Thanks,
Marie
Hi! I don't have a python script, but it should not be difficult to write one based on the MATLAB script. The line you point to calls the sparse
function in MATLAB to create a num_nodes * num_nodes sparse matrix, with edges(:,1), edges(:,2)
as (row, col) indices and edge_attr(:,1)
as values in the corresponding entries. See https://www.mathworks.com/help/matlab/ref/sparse.html?searchHighlight=sparse&s_tid=srchtitle_sparse_1. Then the spones
function transforms the nonzero values into 1.
The node tag here means the node label/type. So there may be multiple nodes with the same type. The second column means number of neighbors of this node, and the following numbers record the indices of these neighbor nodes.
Thanks Muhan!