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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] NN Module Graph Matching Network Model #1271

Closed
Youarerare opened this issue Feb 19, 2020 · 4 comments
Closed

[Feature Request] NN Module Graph Matching Network Model #1271

Youarerare opened this issue Feb 19, 2020 · 4 comments
Assignees

Comments

@Youarerare
Copy link

Youarerare commented Feb 19, 2020

馃殌 Feature

I want to input a pair of graphs and calculate the similarity of the two graphs based on node embedding and edge embedding. I think graph matching will become more and more useful in the future銆侭ut I don't have the ability to achieve it. The implement detail is in https://arxiv.org/pdf/1904.12787.pdf

Pitch

input: a pair of graph
output: the similarity score between them

@yzh119
Copy link
Member

yzh119 commented Feb 21, 2020

Thanks for your suggestion, yes we do think graph matching module is important, I'll take the responsibility to implement this model, please stay tuned.

@amorehead
Copy link
Contributor

I am also interested in achieving something like this, with a siamese GNN architecture. I currently have implemented a baseline model trainer with PyTorch Lightning, but I can only use a batch size of one for the time being since I need to ensure that pairs of graphs are retrieved simultaneously for each forward pass of the network. Any ideas on how I could batch pairs of graphs without having to resort to using a batch size of one?

@BarclayII
Copy link
Collaborator

I am also interested in achieving something like this, with a siamese GNN architecture. I currently have implemented a baseline model trainer with PyTorch Lightning, but I can only use a batch size of one for the time being since I need to ensure that pairs of graphs are retrieved simultaneously for each forward pass of the network. Any ideas on how I could batch pairs of graphs without having to resort to using a batch size of one?

In DGL 0.6 we have a GraphDataLoader that works similarly as torch.utils.data.DataLoader. For instance, you can prepare a dataset of graph pairs and then load them into a pair of batched graphs:

# Set of graph pairs
g = [(
    dgl.graph((torch.randint(0, 10, (20,)), torch.randint(0, 10, (20,)))),
    dgl.graph((torch.randint(0, 10, (20,)), torch.randint(0, 10, (20,))))) for _ in range(200)]
# Dataloader
dl = dgl.dataloading.GraphDataLoader(g, batch_size=10)
# Load
next(iter(dl))
#  [Graph(num_nodes=100, num_edges=200,
#         ndata_schemes={}
#         edata_schemes={}),
#   Graph(num_nodes=100, num_edges=200,
#         ndata_schemes={}
#         edata_schemes={})]

@amorehead
Copy link
Contributor

Thank you for pointing this out, @BarclayII!

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

6 participants