This repository is for a simple implementation of Graph Convolutional Networks. The original paper of GCN is here.
In this repository, there are 2 datasets provided to train the GCN model:
- Citeseer
- Cora
The two datasets can be downloaded in here. The downloaded datasets should be unziped and restored into a directory named datasets
. The following tree shows the path to each files in the datasets:
datasets
├── citeseer
├── citeseer.cites
├── citeseer.content
└── README
└── cora
├── cora.cites
├── cora.content
└── README
-
Install Python 3.
-
Install the Python packages in
requirements.txt
. If you are using a virtual environment for Python package management, you can install all python packages needed by using the following bash command:$ pip install -r requirements.txt
-
Install PyTorch. The version of PyTorch should be greater or equal than 1.7.0. This repository provides the CUDA usage.
-
Modify
config.json
as your machine setting. The following explanations are for understandingtrain_config
ofconfig.json
:num_epochs
: The number of epochs of the training process. Default: 200learning_rate
: The learning of the optimizer for the training process. Default: 0.01
-
Execute training process by
train.py
. An example of usage fortrain.py
are following:$ python train.py --dataset_name=cora
The following bash command will help you:
$ python train.py -h
Dataset | Configurations |
---|---|
Citeseer | num_epochs : 200, learning_rate : 0.01 |
Cora | num_epochs : 200, learning_rate : 0.01 |
Dataset | Maximum Test ACC (%) | Hyperparameters |
---|---|---|
Citeseer | 65.11 ± 0.77 | H : 16, num_layers : 2, dropout : 0.5, regularization : 0.0005 |
Cora | 81.75 ± 0.36 | H : 16, num_layers : 2, dropout : 0.5, regularization : 0.0005 |
- Initially complemented the implementations.
- Refactoring.
- Write docstrings.