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

Is it require to create an adjacency matrix? #436

Closed
senemaktas opened this issue Jul 10, 2023 · 2 comments
Closed

Is it require to create an adjacency matrix? #436

senemaktas opened this issue Jul 10, 2023 · 2 comments

Comments

@senemaktas
Copy link

Hello,

I have created a graph dataset with my own dataset. And it is consist of nodes and labels.
I do not see necessary to create an adjacency matrices for graphs (nodes consist of the features and
I would like to see that model extract the features between those nodes in graph level way). That part is done.

When i run general gnn model it is looking for adjacency matrices. Is it require to create
an adjacency matrix?
I tried giving it as None, but the result is the same.
Here is the error:
File "C:....\general_gnn.py", line 172, in call
z = layer([out, a])
File "C:....\base_layer.py", line 1037, in call
outputs = call_fn(inputs, *args, **kwargs)
File "C:.....\general_conv.py", line 137, in call
x, a, _ = self.get_inputs(inputs)
File "C:....\message_passing.py", line 183, in get_inputs
assert K.is_sparse(a), "A must be a SparseTensor"
AssertionError: A must be a SparseTensor

Thanks for your time.

@danielegrattarola
Copy link
Owner

Short answer: yes, you need an adjacency matrix.
You can just make a fake adjacency matrix with self-loops only (sp.eye) or even all zeros, but at that point, I would question the use of a GNN at all and whether you should instead use a MLP.

Cheers

@senemaktas
Copy link
Author

Yes exactly, I thought same thing and filled adj matrix with ones. I probably confused it with another parameter to define as None. I will try to find proper way to create the matrix. Thank you very much for your answer.

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