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

Processing a single graph in batch mode #23

Closed
motiwari opened this issue Oct 14, 2018 · 3 comments
Closed

Processing a single graph in batch mode #23

motiwari opened this issue Oct 14, 2018 · 3 comments

Comments

@motiwari
Copy link

motiwari commented Oct 14, 2018

Hi @tkipf, thanks for your awesome work and providing this code!

I have a bit of a novice question: I'm trying to process my graph's features through a GCN in mini-batches. I.e. let's say I have a 1000-node graph and I want to process it through the GCN in mini-batches of size 50.

It doesn't seem like the code currently supports this because we have to multiply by the full adjacency matrix in the GCN layer's forward pass - do you have any sense of how I can support these "batch" operations? Better yet, do you have example code that does this?

My code looks something like:

z0 = F.tanh(self.gcn1(x, self.fancy_adj))

where x is a sampled batch of size 50 x F (not the full batch of 1000 x F) and self.fancy_adj is the adjacency matrix transformed as suggested in your paper ( adjacency + identity + row normalized). The problem, of course, is that self.fancy_adj is a 1000 x 1000 matrix. Even if I take just the rows of self.fancy_adj corresponding to the 50 points in the batch, then the adjacency matrix becomes a 50 x 1000 matrix which can't be multiplied by the 50 x F sampled batch.

@tkipf
Copy link
Owner

tkipf commented Oct 18, 2018 via email

@motiwari
Copy link
Author

Thanks @tkipf ! I saw that thread but it looks like it only discusses processing multiple graphs as a block-diagonal matrix, but I'm asking about a single large graph whose adjacency matrix is too large to fit on a single device. Am I missing something?

@tkipf
Copy link
Owner

tkipf commented Oct 20, 2018

In this case, have a look at FastGCN: https://arxiv.org/abs/1801.10247

@tkipf tkipf closed this as completed Oct 20, 2018
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