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

add sampling paradigm #10

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d943ee1
implement node/layer/graph-wise sampling
Nov 10, 2023
57261ea
add graphsage. reorganize training scripts in the examples fold.
Nov 12, 2023
12ffa96
update vanillagcn to vanillgnn; reorganize the sampling abstract.
Nov 13, 2023
41ae1c5
add lazygcn model, but currently it only supports full-batch evaluati…
Nov 15, 2023
d603f88
update lazygcn to lazygnn, and now lazygnn supports mini-batch evalua…
Nov 17, 2023
e52b04e
reorganize the code structure; fix some bugs of ClusterGCN.
Nov 18, 2023
6d7e54c
support multi-workers dataloading; support multi-subgraphs mini-batch…
Nov 21, 2023
f1e527b
save calculated probability; fix bugs in inductive-learning; add batc…
Dec 2, 2023
b02651a
delete useless files.
Dec 3, 2023
efe0d92
add .gitignore
Dec 3, 2023
2a00b6e
Fix the bug of ClusterGCN
TheRoadQaQ Dec 3, 2023
b253bb6
GraphSAINT
TheRoadQaQ Dec 4, 2023
ef019b9
implement C++ version of node-wise sampling for one layer.
Dec 4, 2023
6519321
fix tiny bugs for clustergcn, add nodewisesampler and layerwisesampler.
Dec 4, 2023
c467498
add nodewise/layerwise/graphwise-sampler class
Dec 4, 2023
ad03353
add nodewise/layerwise/graphwise-sampler class
Dec 4, 2023
1b4fee2
Merge branch 'ssq-dev' of https://github.com/TheRoadQaQ/SGL into ssq-dev
TheRoadQaQ Dec 4, 2023
3f42108
Add graphsaint.
TheRoadQaQ Dec 7, 2023
0be039a
add GAugO
Dec 8, 2023
442d3e5
add GAugO
Dec 8, 2023
252d2fd
Merge pull request #1 from TheRoadQaQ/ssq-dev
infinity1009 Dec 8, 2023
4443271
Merge origin/ssq-dev to ssq-dev
Dec 8, 2023
3999fbc
add GAugM
Dec 9, 2023
077d453
add FLAG, but currently it doesn't support sampling-based model, and …
Dec 13, 2023
d0419b7
add PyG-Style GNN models, add sampling-based FLAG (Test for Ogbn-Prod…
Dec 14, 2023
ec4aac1
fix OOM problem when FLAG evaluates on Ogbn-products; test mini-batch…
Dec 16, 2023
d6294cb
add deterministic graph generation part of GAugM
Dec 19, 2023
94daf56
add Mixup model, which supports minibatch training. add HPO codes for…
Dec 24, 2023
9b33e76
change search_config.py
Dec 24, 2023
c5fe9bf
update hp for GAugOMini; change the adj stack method for ClusterGCN; …
Dec 25, 2023
c811513
remove private information.
Jan 6, 2024
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
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__pycache__/


*.egg-info/

build/
dist/

logs/

configs/
57 changes: 57 additions & 0 deletions examples/GDA/configs/FLAG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
dataset:
classname: "Ogbn"
name: "arxiv"
root: "/home/ssq/test_data/"
model:
gnn_type: 'gcn'
hidden_dim: 256
dropout: 0.5
n_layers: 3
step_size: 0.001
augM: 3
batch_norm: True
task:
lr: 0.01
seed: 12345
epochs: 500
patience: 80
weight_decay: 0
# dataset:
# classname: "Ogbn"
# name: "arxiv"
# root: "/home/ssq/test_data/"
# model:
# gnn_type: 'sage'
# hidden_dim: 256
# dropout: 0.5
# n_layers: 3
# step_size: 0.001
# augM: 3
# batch_norm: True
# task:
# lr: 0.01
# seed: 12345
# epochs: 500
# patience: 80
# weight_decay: 0
# dataset:
# classname: "Ogbn"
# name: "arxiv"
# root: "/home/ssq/test_data/"
# model:
# gnn_type: 'gat'
# hidden_dim: 256
# n_heads: '8,8,1'
# dropout: 0.6
# attn_dropout: 0.6
# n_layers: 3
# step_size: 0.001
# augM: 3
# amp: 2
# batch_norm: True
# task:
# lr: 0.002
# seed: 12345
# epochs: 500
# patience: 100
# weight_decay: 0
59 changes: 59 additions & 0 deletions examples/GDA/configs/GAugM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
dataset:
classname: "Planetoid"
name: "cora"
root: "/home/ssq/test_data/"
model:
model_name: 'GAugM'
gnn_type: 'gcn'
feat_norm: 'row'
hidden_dim: 256
dropout: 0.5
n_layers: 2
choose_idx: 5
rm_pct: 2
add_pct: 57
task:
lr: 0.01
seed: 42
epochs: 200
weight_decay: 0.0005
# dataset:
# classname: "Planetoid"
# name: "cora"
# root: "/home/ssq/test_data/"
# model:
# model_name: 'GAugM'
# gnn_type: 'gsage'
# feat_norm: 'row'
# normalize: True
# hidden_dim: 128
# dropout: 0.5
# n_layers: 2
# choose_idx: 2
# rm_pct: 1
# add_pct: 80
# task:
# lr: 0.01
# seed: 42
# epochs: 200
# weight_decay: 0.0005
# dataset:
# classname: "Planetoid"
# name: "cora"
# root: "/home/ssq/test_data/"
# model:
# model_name: 'GAugM'
# gnn_type: 'gat'
# feat_norm: 'row'
# activation: 'elu'
# hidden_dim: 128
# dropout: 0.5
# n_layers: 2
# choose_idx: 2
# rm_pct: 1
# add_pct: 68
# task:
# lr: 0.01
# seed: 42
# epochs: 200
# weight_decay: 0.0005
80 changes: 80 additions & 0 deletions examples/GDA/configs/GAugO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# dataset:
# classname: "Planetoid"
# name: "cora"
# root: "/home/ssq/test_data/"
# model:
# model_name: 'GAugO'
# gnn_type: 'gcn'
# alpha: 1.0
# temperature: 1.2
# hidden_dim: 256
# emb_size: 32
# dropout: 0.5
# n_layers: 2
# gae: true
# feat_norm: 'row'
# sample_type: 'add_sample'
# task:
# lr: 0.01
# seed: 42
# warmup: 0
# beta: 0.8
# epochs: 200
# weight_decay: 0.0005
# pretrain_ep: 160
# pretrain_nc: 30
# max_patience: 50
# dataset:
# classname: "Planetoid"
# name: "cora"
# root: "/home/ssq/test_data/"
# model:
# model_name: 'GAugO'
# gnn_type: 'gsage'
# alpha: 0.13
# temperature: 1.0
# hidden_dim: 256
# emb_size: 32
# dropout: 0.5
# n_layers: 2
# gae: true
# feat_norm: 'row'
# normalize: True
# sample_type: 'add_sample'
# task:
# lr: 0.01
# seed: 42
# warmup: 2
# beta: 3.2
# epochs: 200
# weight_decay: 0.0005
# pretrain_ep: 195
# pretrain_nc: 35
# max_patience: 50
dataset:
classname: "Planetoid"
name: "cora"
root: "/home/ssq/test_data/"
model:
model_name: 'GAugO'
gnn_type: 'gat'
alpha: 0.02
temperature: 1.7
hidden_dim: 128
emb_size: 32
dropout: 0.6
n_layers: 2
activation: "elu"
gae: true
feat_norm: 'row'
sample_type: 'add_sample'
task:
lr: 0.01
seed: 42
warmup: 1
beta: 3.2
epochs: 200
weight_decay: 0.0005
pretrain_ep: 175
pretrain_nc: 45
max_patience: 50
30 changes: 30 additions & 0 deletions examples/GDA/configs/GAugOMini.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
dataset:
classname: "Planetoid"
name: "pubmed"
root: "/home/ssq/test_data/"
model:
model_name: 'GAugO'
gnn_type: 'gcn'
alpha: 0.79
temperature: 1.6
hidden_dim: 256
emb_size: 64
dropout: 0.5
n_layers: 2
gae: true
feat_norm: 'row'
sample_type: 'add_sample'
minibatch: True
task:
lr: 0.01
ep_lr: 0.006
seed: 42
warmup: 7
beta: 3.3
epochs: 200
weight_decay: 0.0005
pretrain_ep: 10
pretrain_nc: 40
max_patience: 50
train_batch_size: 8192
pretrain_batch_size: 8192
20 changes: 20 additions & 0 deletions examples/GDA/configs/Mixup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dataset:
classname: "Planetoid"
name: "pubmed"
root: "/home/ssq/test_data/"
split: "full"
model:
gnn_type: 'sage'
hidden_dim: 256
dropout: 0.5
alpha: 4
beta: 4
n_layers: 3
feat_norm: "none"
batch_norm: True
task:
lr: 0.01
seed: 12345
epochs: 300
patience: 30
weight_decay: 0
78 changes: 78 additions & 0 deletions examples/GDA/configs/SampleFLAG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# dataset:
# classname: "Ogbn"
# name: "products"
# root: "/home/ssq/test_data/"
# sampler:
# training:
# name: "NeighborSampler"
# layer_sizes: "15,10,5"
# prob_type: "normalize"
# replace: False
# eval:
# name: "NeighborSampler"
# layer_sizes: "-1"
# replace: False
# model:
# gnn_type: 'sage'
# hidden_dim: 256
# dropout: 0.5
# n_layers: 3
# step_size: 0.008
# augM: 3
# amp: 2
# batch_norm: False
# task:
# name: "NodeClassification_Sampling"
# lr: 0.003
# seed: 12345
# epochs: 20
# patience: 10
# weight_decay: 0
# train_batch_size: 1024
# eval_batch_size: 4096
# train_num_workers: 12
# eval_num_workers: 12
# eval_together: True
# eval_freq: 2
# eval_start: 10
# loss_fn: "nll_loss"
dataset:
classname: "Ogbn"
name: "arxiv"
root: "/home/ssq/test_data/"
sampler:
training:
name: "NeighborSampler"
layer_sizes: "15,10,5"
prob_type: "normalize"
replace: False
eval:
name: "NeighborSampler"
layer_sizes: "-1"
replace: False
model:
gnn_type: 'gat'
hidden_dim: 64
n_heads: "8,8,1"
dropout: 0.5
n_layers: 3
step_size: 0.008
augM: 3
amp: 2
batch_norm: False
task:
name: "NodeClassification_Sampling"
lr: 0.002
seed: 12345
epochs: 500
patience: 50
weight_decay: 0
train_batch_size: 1024
eval_batch_size: 4096
train_num_workers: 12
eval_num_workers: 12
eval_together: True
pin_memory: True
eval_freq: 2
eval_start: 1
loss_fn: "nll_loss"
36 changes: 36 additions & 0 deletions examples/GDA/configs/SampleMixup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
dataset:
classname: "Ogbn"
name: "arxiv"
root: "/home/ssq/test_data/"
sampler:
training:
name: "NeighborSampler"
layer_sizes: "15, 10, 5"
prob_type: "normalize"
replace: False
eval:
name: "NeighborSampler"
layer_sizes: "-1"
replace: False
model:
gnn_type: 'sage'
hidden_dim: 256
dropout: 0.5
alpha: 4
beta: 4
n_layers: 3
feat_norm: "none"
batch_norm: True
task:
name: "NodeClassification_Sampling"
lr: 0.003
seed: 12345
epochs: 300
patience: 30
weight_decay: 0
train_batch_size: 1024
eval_batch_size: 4096
train_num_workers: 12
eval_num_workers: 12
eval_together: True
eval_freq: 2
Loading