mlabonne / blog

https://mlabonne.github.io/blog/
https://mlabonne.github.io/blog/
31 stars 10 forks source link

GIN: How to Design the Most Powerful Graph Neural Network | Maxime Labonne #10

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

GIN: How to Design the Most Powerful Graph Neural Network | Maxime Labonne

Graph Neural Network Course: Chapter 4

https://mlabonne.github.io/blog/gin/

Pathakvishnu commented 1 year ago

Hi Maxime,

Really intuitive explanation about graph isomorphism network. Appreciate your work you put forward. I have one doubt regarding the dataset creation. Since, I want my custom dataset to passed in dataloader. I have create a dataclass which contains all graph related information like mentioned above i.e. edge_index, feature, and target(label). But I am unable to read that dataclass information through dataloader. Do you have workaround solution for that?

Thanks

mlabonne commented 1 year ago

Hi Pathakvishnu,

Thank you for your kind comment! Regarding your problem, I don't have experience using dataclass to store graphs unfortunately. I think you might want to change your dataclass for a Dataset object, as shown here: https://pytorch-geometric.readthedocs.io/en/latest/tutorial/create_dataset.html You'll be able to access your information with a limited overhead.

Hope it helps,

Maxime

Pathakvishnu commented 1 year ago

Hi Maxime,

Thanks for the quick response :) I followed your idea of changing my dataclass and it really worked. Thanks a lot.

jimohafeezco commented 1 year ago

Hi Maxime, Thanks for this beautiful tutorial.

When we load data to the dataloader in batches, it will automatically increments the edge_index tensor by the cumulated number of nodes of all graphs . This modified edge index tensor is passed into our model eventually and used for training purposes. I want to know if it has any effect on the eventual result and does pytorch geometric has a way of handling this particular kind of scenario.

PS: I am working on a time series data where each succeeding graph is a next time step. I am concerned the modified edge index may have impact on my result. I look forward to hearing from you.

mlabonne commented 1 year ago

Hi Hafeez,

Thank you! Sorry, I'm not sure I understand your question. When you load the data in batches, each batch (subgraph) has its own edge index (as shown at the beginning of this article). You might already be familiar with it, but if you're working with time series data, I recommend checking PyTorch Geometric Temporal.