Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 1.54 KB

README.md

File metadata and controls

30 lines (22 loc) · 1.54 KB

PyTorch implementation of GCN and GAT on Cora

The notebook is organised as follows:

  1. The Cora dataset
  2. GCN: we build our own pytorch_geometric.nn.GCNConv layer.
  3. GAT: we build our own pytorch_geometric.nn.GATConv layer.

The main idea of this project is to learn how the GCN and GAT layers could be implemented in practice. Thus, the presented implementations are not too naive, but also not extremely optimized. If you don't have time to disect the PyG documentation and still want an useful GCN or GAT code, then you might want to check the notebook.

Setup

  1. Clone this repository
git clone https://github.com/arturtoshev/from_gcn_to_gat.git 
cd from_gcn_to_gat
  1. Create a virtual environment using virtualenv or
python3 -m venv ./venv
source venv/bin/activate
  1. You can work on the code with or without CUDA.
    • If you want to work with CUDA, you need the torch version corresponding to your cuda installation, see here. For CUDA 11.1 and torch 1.9.1 you can run pip install -r requirements_cu111.txt
    • If you don't mind waiting a couple of extra second or don't have CUDA, then try pip install -r requirements.txt, which is based on torch 1.9.1. Caution: CPU installation NOT TESTED!

Licence

License: MIT