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

Adding input and output shapes to docs #3573

Closed
Gaurangkarwande opened this issue Nov 26, 2021 · 7 comments
Closed

Adding input and output shapes to docs #3573

Gaurangkarwande opened this issue Nov 26, 2021 · 7 comments

Comments

@Gaurangkarwande
Copy link

Can you add to the documentation the input shape to a layer and the corresponding output shape after forward() has been executed. This is similar to the Pytorch documentation.

For e.g. - the documentation for 2D Convolution layer, nn.torch.Conv2d( ), states that:
input = (N, Cin, H, W)
output = (N, Cout, Hout, Wout)

Motivation

I am fairly new to GNNs and pytorch-geometric. I think it will be a lot easier and smooth for newbies/noobies like me to get a sense of the dimensional transformation within layer.

Additional context

nn.torch.Conv2d( ) -

image

@Gaurangkarwande Gaurangkarwande changed the title Adding input and output dimensions to docs Adding input and output shapes to docs Nov 26, 2021
@rusty1s
Copy link
Member

rusty1s commented Nov 26, 2021

This is a great point, but it will involve a lot of work. Let me know if you want to help me with that.

In general, The input of a GNN layer will be [num_nodes, in_channels] and will output a tensor of shape [num_nodes, out_channels].

@Gaurangkarwande
Copy link
Author

Yeah, I sure can contribute. I am new to GNNs but I can try adding on the documentation for the models I know of are have used.

@rusty1s
Copy link
Member

rusty1s commented Nov 29, 2021

Super. Let's start with a single layer, e.g., GraphConv and go from there. Let me know if you need any more guidance.

@saiden89
Copy link
Contributor

saiden89 commented Dec 10, 2021

Should edge_index and optional tensors like edge_weight be acknowledged as inputs as well?

@rusty1s
Copy link
Member

rusty1s commented Dec 10, 2021

Yeah, that would be something like:

  • edge_index: (2, num_edges)
  • edge_weight: (num_edges)

@saiden89
Copy link
Contributor

Here is a proposal for GraphConv:

image

I've tried to follow as closely as possible the conventions already established in PyTorch, as well as mathematical notations present in the literature. Along these guidelines, the x and edge_index are proxied by the calligraphic typeface V and E respectively, while enclosure with vertical bars (|) refers to the number of elements.
It would also be possible to ditch the mathematical notation altogether in favor of more agnostic solutions, but considering that this framework is specifically aimed towards GNN, I believe that some mathematic rigor can be justified.
Of course, I would love to hear the community's opinion 😄.

@rusty1s
Copy link
Member

rusty1s commented Dec 11, 2021

I think this is great :) Please feel free to contribute!

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

No branches or pull requests

3 participants