This repo contains codes for paper "Approximately Equivariant Graph Networks" (https://arxiv.org/abs/2308.10436)
- Python 3.7+
- Pytorch 1.10+
- Fig 1.: Symmetry model selection example for
$f: \mathbb R^3 \to \mathbb R$ , where$f$ can be non-invariant,$S_2$ -invaraint, or$S_3$ -invariant. Seeproject_subgroup.ipynb
See folder ./image_inpainting
- Figure 2 (left): Bias-Variance tradeoff via graph coarsening
- To reproduce the results, see notebook
graph_coarsen_runs.ipynb
- The linear model baselines are implemented in notebook
graph_coarsen_runs_linear.ipynb
- To reproduce the results, see notebook
- Figure 2 (right): Ablation of coarsened graph symmetry
- To reproduce the results, see notebook
FASHION+hflip_inpainting_reflection.ipynb
- To reproduce the results, see notebook
See folder ./DCRNN_Pytorch
The model architecture and data are adapated from: https://github.com/chnsh/DCRNN_PyTorch
(a) Download the following data folders and store them to ./DCRNN_Pytorch/data
- METR-LA-T3 : G drive link here to download and store the traffic graph signals, with using (T-3, T-2, T-1) graph signals to predict (T, T+1, T+2) graph signals. Data credit to SOURCE
- sensor_graph : G drive link here to download and store the graph adjacency files
(b) Run aut(G)-equivariant DCRNN with the default set-up (c.f. Table 3):
python dcrnn_train_pytorch.py --config_filename=data/model/dcrnn_la_aut_gc_false_t3.yaml --aut True
- To use the sparsified graph adjacency, change the above to
config_filename=data/model/dcrnn_la_sp_aut_gc_false_t3.yaml
- To compare with the vanilla DCRNN, remove
--aut True
./DCRNN_PyTorch
orbit_idx.p
: store the 2-cluster assignmentsorbit_idx_9.p
: store the 9-cluster assignmentdcrnn_train_pytorch.py
: main file to run the experiment
./DCRNN_Pytorch/data/model
dcrnn_la_aut_gc_false_t3.yaml
: config file to run experiments on the original traffic graphdcrnn_la_sp_aut_gc_false_t3.yaml
: config file to run experiments on the sparsified traffic graph
./DCRNN_Pytorch/model/pytorch
dcrnn_supervisor.py
: training scriptdcrnn_model.py
: DCRNN spatial-temporal GNN scriptdcrnn_cell.py
: modified basic graph convolution block to allow (approximate) aut(G) equivariance
See folder ./Human_Pose_Est
The model architecture and data are adapted from: https://github.com/garyzhao/SemGCN
(a) Download data following instructions here
(b) Run models with different symmetry choices, using
-
$\mathcal{S}_{16}$ (Default SemGCN setup):python3 main_gcn_aut.py --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"
- Relax-$\mathcal{S}_{16}$:
python3 main_gcn_aut.py --no_tie --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"
-
$\mathcal{S}_2^2$ (aut(G)):python3 main_gcn_aut.py --aut --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"
- Trivial:
python3 main_gcn_aut.py --triv --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"
(c) Run different model variants (c.f. Table 5):
- Vanilla
$\mathcal{G}$ -Net:python3 main_gcn_aut.py --no_gc --no_ew --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"
-
$\mathcal{G}$ -Net(gc):python3 main_gcn_aut.py --no_ew --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"
-
$\mathcal{G}$ -Net(pt):python3 main_gcn_aut.py --no_gc --no_ew --pointwise --epochs 30 --hid_dim 128 --checkpoint "./checkpoints"