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

torch geometric support + example notebook #863

Merged
merged 4 commits into from
Jul 25, 2022

Conversation

ottonemo
Copy link
Member

Adding support for torch geometric has so far been straight-forward
since its data types also implement the .to() interface and use
tensors in the background, they can basically be passed forward to
the module which will deal with the data type accordingly.

There are probably other places that might still fail, I can imagine
that different data loaders (there are quite a few) might be
problematic in terms of splitting X/y in batches, but this is a
first step forward and we can address these issues once they arise.

Adding support for torch geometric has so far been straight-forward
since its data types also implement the `.to()` interface and use
tensors in the background, they can basically be passed forward to
the module which will deal with the data type accordingly.

There are probably other places that might still fail, I can imagine
that different data loaders (there are quite a [few][1]) might be
problematic in terms of splitting X/y in batches, but this is a
first step forward and we can address these issues once they arise.

[1]: https://pytorch-geometric.readthedocs.io/en/latest/modules/loader.html
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adding this notebook. I'm happy to see that skorch can be made to work with PyTorch Geometric without too many adjustments. Given that those adjustments are not trivial, however, it's good to have a notebook to showcase them. Kudos for figuring out the minimal set of steps to take.

Could you please add a link to the notebooks README?

Regarding the notebook, I only have minor comments:

How to do batching with skorch + torch geometric will not be handled here.

I assume because it's not trivial? If so, could you please indicate that.

we need our own loader that strips the first dimension to match the predicted y and the labelled y in length

Alternatively, we could probably override get_loss and extract the first dimension from y in there, right? Maybe that is not better, but you mentioned that PyTorch Geometric provides a bunch of custom data loaders, so they could not be used in conjunction with RawLoader.

Regarding the end of the notebook, it would help to have some kind of conclusion about the result. E.g. why does the model not reach the same test score as in the linked tutorial?

@ottonemo ottonemo requested a review from BenjaminBossan July 22, 2022 16:53
Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. I especially like the conclusion. Just one more thing: Please link the notebook in the notebooks/README.md

@ottonemo ottonemo requested a review from BenjaminBossan July 25, 2022 11:47
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

Successfully merging this pull request may close these issues.

2 participants