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

How to apply HGP-SL to dense batched adjacency matrix #9

Open
suyouooooo opened this issue Feb 3, 2021 · 3 comments
Open

How to apply HGP-SL to dense batched adjacency matrix #9

suyouooooo opened this issue Feb 3, 2021 · 3 comments

Comments

@suyouooooo
Copy link

Hi, thanks for your code.
In my code, I must change my batched sparse adjacency matrices to a single dense batched adjacency matrix since my adjacency matrix is very big.
However, when I apply HGP-SL to my code, the error happens
ValueError: too many values to unpack (expected 2)
So I check the code, and I found row, col = edge_index in layers.py. which means that the parameter passes to HGP-SL must be sparse adjacency matrix. I really want to use HGP-SL in my code, but I don't know how to change the code in HGP-SL so that I can use dense batched adjacency matrix as the parameter.
截屏2021-02-03 下午10 03 19

@cszhangzhen
Copy link
Owner

Hi,

The current version only support sparse matrix. If you want to use dense matrix, the following parts should be modified:

  1. use DenseGCNConv in convolution layer;
  2. the calculation of NodeInformationScore should follow the matrix multiplication in Eq(2);
  3. in structure learning module, the sparse_softmax function can be replaced with the function here ;

@suyouooooo
Copy link
Author

suyouooooo commented Feb 19, 2021

Thanks for your reply, sorry to bother you again.

  1. I don't understand "the calculation of NodeInformationScore should follow the matrix multiplication in Eq(2)". As far as I am considered, Eq(2) is :

截屏2021-02-19 上午11 03 21

And the calculation of NodeInformationScore is :

截屏2021-02-19 上午11 04 27

I think it already have followed the matrix multiplication in Eq(2), so I don't know how to change the class 'NodeInformationScore'.
  1. in structure learning module, the former sparse_softmax function is :

截屏2021-02-19 上午11 09 08

when I replace the sparse_softmax function, the number of parameters goes from two to one, so I wonder if I should just pass the parameter 'weights'?

Looking forward to receiving your reply.

@cszhangzhen
Copy link
Owner

Hi,

Sorry for the late reply.

1, The code of NodeInformationScore class indeed perform matrix multiplication in Eq(2), but they are in sparse multiplication form. You need to transform them in the dense form.

2, Ye, you only need to pass the weight, but you need to re-write the function, maybe you can use this reference

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

2 participants