The notebook is organised as follows:
- The Cora dataset
- GCN: we build our own
pytorch_geometric.nn.GCNConv
layer. - 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.
- Clone this repository
git clone https://github.com/arturtoshev/from_gcn_to_gat.git
cd from_gcn_to_gat
- Create a virtual environment using
virtualenv
or
python3 -m venv ./venv
source venv/bin/activate
- 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!
- 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