Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 1.52 KB

File metadata and controls

36 lines (21 loc) · 1.52 KB

(Linear) Graph Transformer

Pytorch code for reproducing experiments for the following paper:

Graph Transformers Dream of Electric Flow. Xiang Cheng, Lawrence Carin, Suvrit Sra, ICLR 2025

ZINC Experiments

The files for the the ZINC regression experiments are found under the ZINC folder. To reproduce the experiments, run (in order):
  • zinc_exp_init.ipynb
  • zinc_exp_LT.ipynb

For comparison, the baseline Laplacian Eigenvector implementation is found in

  • zinc_exp_baseline_LapPE.ipynb

The train/val/test data can be downloaded here:

ZINC_dgl_clean_20k
ZINC_pytorch_clean_20k

Alternatively, you can also generate the data yourself using the code found here.

Code for base Graph Transformer implementation is taken from https://github.com/xbresson/CS6208_2023

Synthetic Experiments

The files for the the synthetic experiments are found under the synthetic folder:
  • electric_experiment_synthetic.ipynb runs the experiments for electric/resistance/heat problems
  • electric_experiment_plot does the plotting
  • ev_experiment_synthetic.ipynb runs the experiments for eigenvector computation
  • ev_experiment_plot.ipynb does the plotting

The code in electric_experiment_synthetic is pretty messy (sorry), email me if you need help parsing the code.