Giter Site home page Giter Site logo

kvignesh1420 / rlap Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 399 KB

[ICML 2023] Official implementation of "A randomized schur complement based graph augmentor"

Home Page: https://proceedings.mlr.press/v202/kothapalli23a.html

License: MIT License

C++ 25.36% C 0.12% Python 66.29% Starlark 1.69% Jupyter Notebook 1.66% Shell 4.88%
graph-neural-networks randomized-algorithms contrastive-learning graph-diffusion schur-complement

rlap's Introduction

Randomized Schur Complement Views for Graph Contrastive Learning

This work introduces a randomized topological augmentor based on Schur complements for Graph Contrastive Learning (GCL). The rLap augmentor is written in C++ (with Python bindings) and uses Eigen for representing sparse matrices which aids in efficient traversal and indexing into matrices. Additionally, the relevant data structures for sampling edges are inspired from the Laplacians.jl effort.

Generalized GCL framework. The augmentor is effective for GCL with varying design choices of encoders and objectives.

The motivation and methodology behind rLap is presented in my ICML 2023 paper.

Citation

@inproceedings{Kothapalli2023RandomizedSC,
  title={Randomized Schur Complement Views for Graph Contrastive Learning},
  author={Vignesh Kothapalli},
  booktitle={International Conference on Machine Learning},
  year={2023}
}

Setup

# create virtual environment
$ python3.9 -m virtualenv .venv
$ source .venv/bin/activate

# build the C++ code and create python bindings
$ bazel build //rlap:all

# package the library along with .so files from bazel-bin
# if linux
$ python setup.py --data bazel-bin -q bdist_wheel
# if macos
$ python setup.py --data bazel-bin -q bdist_wheel --plat-name macosx_10_14_x86_64

# install
$ pip install dist/*.whl

Usage

The pytorch geometric implementation of the augmentor is based on the PyGCL library for reproducible experiments and is available in augmentor_benchmarks.py. Additionally, a DGL implementation is made available in CCA-SSG/aug.py.

Benchmarks

Use the following shell script to benchmark all the augmentors on node and graph classification datasets

$ bash run_augmentor_benchmarks.sh

Use the following python script to prepare the latex table of benchmark results. The table will be properly filled only when CPU and GPU based benchmarks have completed. Interrupting the previous script to generate the table will lead to parsing errors for incomplete runs.

$ python prepare_augmentor_stats.py

Node and graph classification experiments

Use the following shell script to run node classification experiments using the GRACE design

$ bash run_node_shared.sh

Use the following shell script to run node classification experiments using the MVGRL design

$ bash run_node_dedicated.sh

Use the following shell script to run graph classification experiments using the GraphCL design

$ bash run_graph_shared.sh

Use the following shell script to run graph classification experiments using the BGRL (g-l) design

$ bash run_graph_shared_g2l.sh

Use the following python script to prepare the latex table of results

$ python prepare_final_stats.py

Additional experiments

Use the following shell script to run max singular value and edge count analysis of rlap variants

Applying rLap follwed by Diffusion is equivalent in expectation to Diffusion and sub-sampling

$ python rlap_vc_spectral.py

Use the following shell script to plot edge counts of randomized schur complements after diffusion

$ python rlap_ppr_edge_plots.py

Contributing

Please feel free to open issues and create pull requests to fix bugs and improve performance.

License

MIT

rlap's People

Contributors

dependabot[bot] avatar kvignesh1420 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.