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

[Model] Graphsaint #194

Merged
merged 48 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bbeff41
Reformat code
THINK2TRY Jan 24, 2021
07386b6
Add custom dataset and remove dependency on PyG of stpgnn
THINK2TRY Jan 24, 2021
5c0a346
Fix a bug in experiment
THINK2TRY Jan 24, 2021
406069f
Add PPI and PPI-Large
THINK2TRY Jan 24, 2021
4229e9c
Fix bugs in PPRGo trainer
THINK2TRY Jan 24, 2021
b6f33c8
Fix bugs in subgraph sampling
THINK2TRY Jan 24, 2021
ffb0072
Simplify node_classification test
THINK2TRY Jan 25, 2021
2a6feff
Add tests for graphsage
THINK2TRY Jan 25, 2021
44c7101
Merge remote-tracking branch 'upstream/master'
THINK2TRY Jan 25, 2021
2b5570f
Merge remote-tracking branch 'origin/custom_dataset'
THINK2TRY Jan 25, 2021
aa18bd4
Add dataset description
THINK2TRY Jan 26, 2021
39c9799
Support multi-label classification
THINK2TRY Jan 26, 2021
f4fb165
Add dataset description and support multi-label classification
THINK2TRY Jan 26, 2021
28a94fc
Merge branch 'enrich_dataset'
THINK2TRY Jan 26, 2021
13cc229
Resolve conflicts
THINK2TRY Jan 27, 2021
75ceff6
Fix bugs in dblp/youtube-ne dataset
THINK2TRY Jan 26, 2021
da3d21e
Update README
THINK2TRY Jan 27, 2021
3931314
Modify GAT for inductive settings
THINK2TRY Jan 28, 2021
9b17c6e
Modify GAT for inductive settings
THINK2TRY Jan 28, 2021
eb2f0d4
Merge branch 'gat'
THINK2TRY Jan 28, 2021
0fbdced
Modify GAT for inductive settings and add tests
THINK2TRY Jan 28, 2021
0a0fe3b
Merge upstream
THINK2TRY Jan 29, 2021
2892861
Fix bugs in GAT test
THINK2TRY Jan 29, 2021
d2f10e8
[Feature] remove ogb's dependency on pyg
icycookies Feb 1, 2021
8d3c0cb
Merge branch 'master' of https://github.com/THUDM/cogdl into THUDM-ma…
icycookies Feb 1, 2021
ad470d6
Merge branch 'THUDM-master' into ogb
icycookies Feb 1, 2021
fc44353
fix typo
icycookies Feb 1, 2021
383f3dc
modify graphsaint
icycookies Feb 8, 2021
d64fca2
fix typo
icycookies Feb 8, 2021
a9f5834
modify sampled trainer
icycookies Feb 9, 2021
5d1bb8c
Add ClusterGCN and modify Trainers
THINK2TRY Feb 25, 2021
369bc9b
Add hyper-parameters for several models
THINK2TRY Feb 25, 2021
7d8ed4a
Add gespmm and apply to gcn-like models
THINK2TRY Feb 25, 2021
4cc7a87
Add src of gespmm
THINK2TRY Feb 25, 2021
74c95d8
Resolve conflicts
THINK2TRY Feb 25, 2021
9bd085d
Merge upstream
THINK2TRY Feb 25, 2021
a51d64c
Merge branch 'master' of https://github.com/THUDM/cogdl
THINK2TRY Feb 26, 2021
2fa77b3
[Feature] add graphsaint model; modify graphsaint sampler: using subg…
icycookies Feb 28, 2021
b8dc0f0
Merge pull request #8 from THUDM/master
icycookies Feb 28, 2021
a294031
remove lineprofiler
icycookies Feb 28, 2021
230f917
Merge branch 'graphsaint' of https://github.com/yyhslyz/cogdl into gr…
icycookies Feb 28, 2021
9c0d894
pass tests
icycookies Feb 28, 2021
883c242
[Feature] add unit test for graphsaint; add architectural parameters …
icycookies Mar 1, 2021
51f1ff5
remove redundant lines
icycookies Mar 1, 2021
64ed665
resolve conflicts
THINK2TRY Mar 2, 2021
f8bde1a
Merg upstream
THINK2TRY Mar 2, 2021
9d1dfb5
Merge graphsaint and modify test
THINK2TRY Mar 2, 2021
ced3fec
Fix bugs in ogb.py
THINK2TRY Mar 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ before_script:
script:
- export DGLBACKEND=pytorch
- export METIS_DLL=~/.local/lib/libmetis.so
- ls ~/.local/lib && echo $METIS_DLL
- coverage run --source=cogdl -m pytest tests
- cd docs && make clean && make html && cd ..

Expand Down
11 changes: 10 additions & 1 deletion cogdl/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ def _build_adj_(self):
self.__adj = sparse.csr_matrix(
(edge_attr_np, (edge_index_np[0], edge_index_np[1])), shape=(num_nodes, num_nodes)
)
return self.__adj

def _eliminate_adj_(self):
self.__adj = None
self.edge_row = None
self.edge_col = None
self.node_idx = None

def subgraph(self, node_idx):
"""Return the induced node subgraph."""
Expand All @@ -240,7 +247,7 @@ def subgraph(self, node_idx):
attrs["edge_attr"] = edge_attr
return Data(**attrs)

def edge_subgraph(self, edge_idx):
def edge_subgraph(self, edge_idx, require_idx=False):
"""Return the induced edge subgraph."""
if isinstance(edge_idx, torch.Tensor):
edge_idx = edge_idx.cpu().numpy()
Expand All @@ -260,6 +267,8 @@ def func(x):
attrs["edge_index"] = edge_index
if edge_attr is not None:
attrs["edge_attr"] = edge_attr
if require_idx:
return Data(**attrs), node_idx, edge_idx
return Data(**attrs)

def sample_adj(self, batch, size=-1, replace=True):
Expand Down
Loading