GitXplorerGitXplorer
f

forwardgnn

public
9 stars
1 forks
0 issues

Commits

List of commits on branch main.
Unverified
73fe25720afd0f854e49c099f9c2517c0549617d

Initial commit

nnamyongp committed 5 months ago

README

The README file for this repository.

Forward Learning of Graph Neural Networks

This repository provides the code of the ForwardGNN framework presented in the paper "Forward Learning of Graph Neural Networks", Namyong Park, Xing Wang, Antoine Simoulin, Shuai Yang, Grey Yang, Ryan Rossi, Puja Trivedi, Nesreen Ahmed, The Twelfth International Conference on Learning Representations (ICLR) 2024.

Learning graph neural networks (GNNs) with (a) backpropagation and (b)-(d) the proposed forward learning approaches of the ForwardGNN framework: (a) Backpropagation involves one forward pass, followed by one backward pass through the network. (b) The forward-forward approach involves two forward passes on positive and negative inputs. (c) The single-forward approach learns via just one forward pass. (d) The single-forward approach is extended to incorporate top-down signals.

Installation

Running install_packages.sh sets up the conda environment named ForwardLearningGNN and installs required packages.

Datasets

Datasets used in the paper will be downloaded in the data folder when the code runs for the first time.

Data Splits

Node and edge splits to be used for node classification and link prediction, respectively, will be generated in the datasplits folder when the code runs for the first time. To use the node and edge splits used for the experiments in the paper, download them from this repository, and place them in the datasplits folder.

How to Run

Scripts in exp/nodeclass/ and exp/linkpred/ can be used to train GNNs using the proposed forward learning algorithms of ForwardGNN or backpropagation for node classification and link prediction, respectively.

Directory Structure

  • src/: source code root directory
  • exp/: directory with scripts to train GNNs using the proposed forward learning algorithms and backpropagation
  • data/: directory to store graph data files
  • datasplits/: directory to store graph data splits

Citation

If you use code in this repository in your own work, please cite our paper.

@inproceedings{park2024forwardgnn,
  title={Forward Learning of Graph Neural Networks},
  author={Namyong Park and Xing Wang and Antoine Simoulin and Shuai Yang and Grey Yang and Ryan Rossi and Puja Trivedi and Nesreen Ahmed},
  booktitle={ICLR},
  year={2024},
}

License

The majority of the ForwardGNN project is licensed under CC-BY-NC, however portions of the project are available under separate license terms. The GCN and GraphSAGE operators in the gnn folder adapted the PyG's implementation, which is licensed under the MIT license. The forward learning algorithms in the nodeclass and linkpred folders build upon the Nebuly's implementation of the forward-forward algorithm, which is licensed under the Apache-2.0 license.

Contributing

See the CONTRIBUTING file for how to contribute to the project.