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

Heterogeneous Graph Support + GraphGym #3068

Merged
merged 109 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
365005f
added HGT DBLP example
rusty1s Jun 9, 2021
d68f5a2
typo
rusty1s Jun 9, 2021
fbf4338
Merge remote-tracking branch 'origin/hgt_example'
rusty1s Jun 9, 2021
af80b93
Merge PyG master (#52)
rusty1s Jun 18, 2021
06e097d
Merge branch 'rusty1s:master' into master
rusty1s Jun 18, 2021
d6544f0
Merge branch 'rusty1s:master' into master
rusty1s Jun 18, 2021
77d43c8
revert
rusty1s Jun 18, 2021
5022d66
Merge branch 'rusty1s:master' into master
rusty1s Jun 18, 2021
9625c13
Merge branch 'rusty1s:master' into master
rusty1s Jun 18, 2021
7503da1
Fix Documentation Rendering (#51)
rusty1s Jun 19, 2021
03ee600
remove pytorch 1.7.0 legacy code (#50)
rusty1s Jun 19, 2021
19aa8f9
Merge branch 'rusty1s:master' into master
rusty1s Jun 19, 2021
9016c36
Fix `copy.deepcopy` within lazy `nn.dense.Linear` (#44)
rusty1s Jun 20, 2021
2c9c6b8
Merge branch 'rusty1s:master' into master
rusty1s Jun 23, 2021
9f3916f
t checkout Merge branch 'master' of github.com:vrtex-team/pytorch_geo…
rusty1s Jun 23, 2021
6a35c8f
example to doc
rusty1s Jun 23, 2021
061e7e2
resolve conflict
rusty1s Jun 27, 2021
d959268
resolve conflict
rusty1s Jun 27, 2021
fc3d1a2
Merge branch 'rusty1s:master' into master
rusty1s Jun 27, 2021
6178a40
Add Figure and Equation to `to_hetero` docstring (#60)
rusty1s Jun 27, 2021
95778f0
Merge branch 'rusty1s:master' into master
rusty1s Jun 27, 2021
2489dfb
Message Passing Hooks (#53)
rusty1s Jun 28, 2021
2db5204
Rename `HeteroData.get_edges` and `HeteroData.get_nodes` (#58)
rusty1s Jun 29, 2021
794e3b1
Merge branch 'rusty1s:master' into master
rusty1s Jun 29, 2021
b08ec35
`HeteroConv` (#64)
RexYing Jun 29, 2021
f3c7375
fix documentation
rusty1s Jun 29, 2021
7b91a47
bipartite function
rusty1s Jun 30, 2021
6e290a7
fix test CI
rusty1s Jul 3, 2021
3974643
remove pillow version
rusty1s Jul 7, 2021
fb13c6b
clean up for merge
rusty1s Jul 7, 2021
b47e263
Merge PyG master (#69)
rusty1s Jul 7, 2021
fb7db6b
re-merge
rusty1s Jul 7, 2021
02160d0
add lazy column to GNN cheatsheet (#70)
rusty1s Jul 8, 2021
5580924
`to_hetero_with_bases(model)` (#63)
rusty1s Jul 8, 2021
3c6392d
rename
rusty1s Jul 8, 2021
adf9946
add legend
rusty1s Jul 8, 2021
851e67d
fix typo
rusty1s Jul 8, 2021
644ff98
Test: Check equal outputs of `to_hetero` and `RGCNConv` (#59)
rusty1s Jul 12, 2021
7d944ed
`HeteroData` support for `T.NormalizeFeatures` (#56)
rusty1s Jul 16, 2021
f1e446d
`HeteroData` support for `T.AddSelfLoops` (#54)
rusty1s Jul 16, 2021
2e5c7ef
`HeteroData` support for `T.ToSparseTensor` (#55)
rusty1s Jul 16, 2021
da3e839
`HeteroData` support for `T.ToUndirected` (#57)
rusty1s Jul 16, 2021
1b259bc
resolve merge conflicts
rusty1s Jul 18, 2021
0ba505e
resolve merge conflicts 2
rusty1s Jul 18, 2021
1546598
resolve merge conflicts 3
rusty1s Jul 18, 2021
4eea1e9
Merge PyG master (#74)
rusty1s Jul 18, 2021
3b2b529
re-add
rusty1s Jul 18, 2021
f81a772
GraphGym cleaned version (#82)
JiaxuanYou Aug 2, 2021
128e4e2
Update .gitignore
rusty1s Aug 3, 2021
fccf931
Integrate GraphGym into PyG (#85)
JiaxuanYou Aug 5, 2021
fbaad8b
add import
rusty1s Aug 5, 2021
63b4ae8
clean up LICENSE
rusty1s Aug 5, 2021
d0c0f70
fix import
rusty1s Aug 5, 2021
c6a9c8a
resolve merge conflicts
rusty1s Aug 6, 2021
8bc5ce7
resolve merge conflicts 2
rusty1s Aug 6, 2021
acee40e
Merge PyG master (#87)
rusty1s Aug 6, 2021
7f234b8
resolve merge conflicts 3
rusty1s Aug 6, 2021
276e345
resolve merge conflicts 4
rusty1s Aug 6, 2021
af7d6b8
Implementation of the `HGTLoader` + `ogbn-mag` example (#73)
rusty1s Aug 6, 2021
7742992
rename
rusty1s Aug 6, 2021
475cabd
linting
rusty1s Aug 6, 2021
ed3a192
Random split functionalities (#72)
RexYing Aug 12, 2021
b107cd6
add basetransform
rusty1s Aug 12, 2021
6867510
typo
rusty1s Aug 12, 2021
7e218fa
typo
rusty1s Aug 12, 2021
11fd829
fix test
rusty1s Aug 16, 2021
3efb8a9
Improve `torch_geometric.data` Documentation (#98)
rusty1s Aug 17, 2021
8de9302
add/fix data functionality
rusty1s Aug 17, 2021
9af1c39
linting
rusty1s Aug 17, 2021
1d58297
typo
rusty1s Aug 17, 2021
9381899
`_parent` memory leak fix (#103)
rusty1s Aug 17, 2021
f402f86
rename reverse
rusty1s Aug 17, 2021
89255f7
(Heterogeneous) `NeighborLoader` (#92)
rusty1s Aug 18, 2021
ad6763e
fix doc
rusty1s Aug 18, 2021
3e40c41
Add benchmark code and the example with existing graph classification…
yzhao062 Aug 19, 2021
d89feed
Move `HGTLoader` to `torch_geometric.loader` + clean up (#104)
rusty1s Aug 20, 2021
b3cbf7d
rename
rusty1s Aug 20, 2021
9c0e3c6
Support GraphGym custom modules outside PyG package (#102)
JiaxuanYou Aug 21, 2021
7e3c4c2
Rename `AddTrainValTestMask` to `RandomNodeSplit` (#108)
rusty1s Aug 23, 2021
4ccecd8
create optimizer config and scheduler config separately (#113)
yaoyaowd Aug 24, 2021
b71befc
Heterogeneous Graph Tutorial (#83)
rusty1s Aug 24, 2021
b1b02cb
typo
rusty1s Aug 24, 2021
f4cdf8a
Move data loaders to `torch_geometric.loader` (#110)
rusty1s Aug 24, 2021
ee31681
Lazy GNN operators (#89)
rusty1s Aug 24, 2021
b416653
rename (#116)
rusty1s Aug 26, 2021
a4524c5
Revisit `MetaPath2Vec` (#114)
rusty1s Aug 26, 2021
ce70c90
Clean up `torch_geometric.profile` further (#111)
rusty1s Aug 26, 2021
6296fe0
readme highlights and quick tour (#99)
RexYing Aug 26, 2021
2f9ccdb
fix broken links
rusty1s Aug 26, 2021
da1d26e
fix links
rusty1s Aug 26, 2021
373591e
Heterogeneous Graph Sampler Tutorial (#117)
rusty1s Aug 26, 2021
2a2b48d
remove todo
rusty1s Aug 26, 2021
8bde91f
typo
rusty1s Aug 26, 2021
09c31a5
Conversion between heterogenous and homogeneous graph objects (#115)
yzhao062 Aug 27, 2021
25b5a08
fix test
rusty1s Aug 27, 2021
31d1c05
update doc
rusty1s Aug 30, 2021
de79862
deprecate NeighborSampler (#119)
rusty1s Aug 31, 2021
6c91c60
Move `torch_geometric.data.DataLoader` to `torch_geometric.loader.Dat…
rusty1s Aug 31, 2021
6a668de
fix __cat_dim__
rusty1s Aug 31, 2021
445686f
updategp
rusty1s Sep 1, 2021
2ae4c8f
Deprecate `train_test_split_edges` + Modifications to `RandomLinkSpli…
rusty1s Sep 1, 2021
00e2e2e
Create example to load `*.csv` and transfer to `HeteroData` (#76)
yaoyaowd Sep 2, 2021
717484e
merge
rusty1s Sep 2, 2021
4cc4747
typo
rusty1s Sep 2, 2021
7c24d5d
fix
rusty1s Sep 2, 2021
49c949e
typo
rusty1s Sep 2, 2021
d47dad4
update
rusty1s Sep 2, 2021
7c08f7d
fix
rusty1s Sep 2, 2021
ca836a6
fix
rusty1s Sep 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ jobs:
pip install pandas
pip install h5py
pip install numba
pip install tabulate
pip install git+https://github.com/the-virtual-brain/tvb-geodesic.git
pip install pytorch-memlab

- name: Install main package
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ runs/
.eggs/
lightning_logs/
*.egg-info/
.ipynb_checkpoints
.coverage
.coverage.*
coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020 Matthias Fey <[email protected]>
Copyright (c) 2021 Matthias Fey, Jiaxuan You <[email protected], [email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
221 changes: 171 additions & 50 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions benchmark/kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ Run (or modify) the whole test suite via
```
$ python main.py
```

For more comprehensive time-measurement and memory usage information, you may use

```
$ python main_performance.py
```
79 changes: 79 additions & 0 deletions benchmark/kernel/main_performance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import argparse
from itertools import product

import torch

from torch_geometric import seed_everything
from torch_geometric.loader import DataLoader
from torch_geometric.profile import profileit, timeit, get_stats_summary

from datasets import get_dataset
from train_eval import train, eval_acc

from gcn import GCN
from graph_sage import GraphSAGE
from gin import GIN

seed_everything(0)

parser = argparse.ArgumentParser()
parser.add_argument('--epochs', type=int, default=100)
parser.add_argument('--batch_size', type=int, default=128)
parser.add_argument('--lr', type=float, default=0.01)
parser.add_argument('--warmup_profile', type=int, default=1,
help='Skip the first few runs')
parser.add_argument('--goal_accuracy', type=int, default=1,
help='The goal test accuracy')
args = parser.parse_args()

layers = [1, 2, 3]
hiddens = [16, 32]

datasets = ['MUTAG', 'PROTEINS', 'IMDB-BINARY', 'REDDIT-BINARY']

nets = [
GCN,
GraphSAGE,
GIN,
]

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

# Decorate train and eval functions:
train = profileit(print_layer_stats=False)(train)
eval_acc = timeit()(eval_acc)

for dataset_name, Net in product(datasets, nets):
dataset = get_dataset(dataset_name, sparse=True)
num_train = int(len(dataset) * 0.8)
num_val = int(len(dataset) * 0.1)

train_dataset = dataset[:num_train]
val_dataset = dataset[num_train:num_train + num_val]
test_dataset = dataset[num_train + num_val:]

train_loader = DataLoader(train_dataset, batch_size=args.batch_size,
shuffle=True)
val_loader = DataLoader(val_dataset, batch_size=args.batch_size,
shuffle=False)
test_loader = DataLoader(test_dataset, batch_size=args.batch_size,
shuffle=False)

for num_layers, hidden in product(layers, hiddens):
print('-----\n{} - {} - {} - {}'.format(dataset_name, Net.__name__,
num_layers, hidden))

model = Net(dataset, num_layers, hidden).to(device)
optimizer = torch.optim.Adam(model.parameters(), lr=args.lr)

stats_list = []
for epoch in range(1, args.epochs + 1):
loss, stats = train(model, optimizer, train_loader)
val_acc, val_time = eval_acc(model, val_loader)
test_acc, test_time = eval_acc(model, test_loader)

if epoch >= args.warmup_profile:
stats_list.append(stats)

stats_summary = get_stats_summary(stats_list)
print(stats_summary)
2 changes: 1 addition & 1 deletion benchmark/kernel/train_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from torch import tensor
from torch.optim import Adam
from sklearn.model_selection import StratifiedKFold
from torch_geometric.data import DataLoader, DenseDataLoader as DenseLoader
from torch_geometric.loader import DataLoader, DenseDataLoader as DenseLoader

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

Expand Down
2 changes: 1 addition & 1 deletion benchmark/points/train_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import torch.nn.functional as F
from torch.optim import Adam
from torch_geometric.data import DataLoader
from torch_geometric.loader import DataLoader

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

Expand Down
179 changes: 179 additions & 0 deletions docs/source/_figures/edge_conv.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/source/_figures/edge_conv.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
\documentclass{standalone}

\usepackage{bm}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (0,0) {$\bm{x}_i^{\prime} = \max_{j \in \mathcal{N}(i)} \textsc{MLP}_{\hspace{-1pt}\theta} \big([ \bm{x}_i, \bm{x}_j - \bm{x}_i ]\big)$};
\end{tikzpicture}

\end{document}
Loading