Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjacency matrix generation #53

Open
mingyangligithub opened this issue May 8, 2023 · 0 comments
Open

adjacency matrix generation #53

mingyangligithub opened this issue May 8, 2023 · 0 comments

Comments

@mingyangligithub
Copy link

Dear authors,

Thanks for your work! It provides a very detailed example of graph classification.
I have some confusions when I studied the code. Could you please give me some help on them? Thank you very much!

In the file DGCNN_embedding --> gnn_lib --> PrepareSparseMatrices, the function generates adjacency matrix (eg. n2n_idxes) randomly using Longtensor 'n2n_idxes = torch.LongTensor(2, total_num_edges * 2)'. Shouldn't it depend on the graph? The code bellow it 'n2n_vals = torch.FloatTensor(total_num_edges * 2)' generates float values randomly. Shouldn't just be 1?

When I reproduced the programme, there was an error here '[sparse.FloatTensor: size is inconsistent with indices]'. There is a solution about this error: 'I think, you may try the code below n2n_idxes = torch.LongTensor(torch.randint(1, num_nodes, [2, num_edges * 2])) instead of n2n_idxes = torch.LongTensor(2, num_edges * 2)'

I think the problem I met is the initial code generates long tensor like 5051019120366827712, but it is out of range of the size n2n_sp, which is [total_num_nodes, total_num_nodes]. So the solution tries to generate index between number 1 to total_num_nodes. Yeah, it also means that the index is generated randomly. How to solve this running error? Is randomly generation correct?

Thanks again!

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant