Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Pytorch Geometric support (deprecates KGCN) #161

Merged
merged 124 commits into from
Jul 28, 2022

Conversation

jmsfltchr
Copy link
Contributor

@jmsfltchr jmsfltchr commented Jul 8, 2022

What is the goal of this PR?

Migrate the ethos of TypeDB-ML to be a library to support machine learning using existing graph learning frameworks, starting with support for PyTorch Geometric and NetworkX to support in-memory graphs and general-purpose graph algorithms.

What are the changes implemented in this PR?

  • Encoding of a TypeDB graph (already exported into NetworkX) into a PyTorch Geometric HeteroData object
  • Updating the Diagnosis example to demonstrate how to create a GNN using TypeDB, TypeDB-ML and PyTorch Geometric
  • Refactoring of the project structure
  • Many minor build updates

Solves #44

@jmsfltchr jmsfltchr self-assigned this Jul 8, 2022
@jmsfltchr jmsfltchr changed the title Pytorch Geometric support (Deprecates KGCNs) Pytorch Geometric support (deprecates KGCNs) Jul 8, 2022
@jmsfltchr jmsfltchr changed the title Pytorch Geometric support (deprecates KGCNs) Pytorch Geometric support (deprecates KGCN) Jul 8, 2022
James Fletcher added 25 commits July 19, 2022 18:07
…uild due to tensorflow issue. A previously used patch is no longer applicable to v0.8.0 of rules_python.
…r, split out a separate labeller specifically for the binary link prediction case.
… came from the conversion of a homogeneous graph network into a heterogeneous one. Seemed impossible to debug the call graph creation in pytorch.

Now the model runs, but the current issue is getting the model to see the negative samples too. Perhaps a different approach is required (NxN adjacency for the edge concerned).
…roach is easily applicable to predicting all edges in an adjacency matric, as per the link_prediction example.
…tures are given as tensors manually for each node. When given as numpy arrays this way of adding features works fine.
…layer, and now the learner learns with 100% accuracy on train and validation and 91% on test!
…ed for later use as well as the entry from edge_label_index_dict
This was referenced Jul 27, 2022
@jmsfltchr jmsfltchr marked this pull request as ready for review July 28, 2022 09:34
@jmsfltchr jmsfltchr requested a review from lolski July 28, 2022 09:34
@lolski
Copy link
Member

lolski commented Jul 28, 2022

Approved for the build only. The API contains many changes and most of them are fundamental. They will be reviewed later in a longer discussion (most probably in person) with James and Joshua.

@@ -0,0 +1,66 @@
#
Copy link
Member

Choose a reason for hiding this comment

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

What is the difference between requirements.txt and install_requires.txt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We discussed this in-person: install_requires.txt is used to fill the field of the same name for PyPi. We need this because the assemble-pip target doesn't support the flags that we need in the requirements.txt file. This is an issue and should be resolved better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lolski lolski merged commit 57ccda7 into typedb:master Jul 28, 2022
@jmsfltchr jmsfltchr mentioned this pull request Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants