Skip to content

PyTorch Geometric implementations of GraphSAGE and GAT (Graph Attention Networks) for node classification on citation networks.

Notifications You must be signed in to change notification settings

abasit/gnn-node-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph Neural Networks for Node Classification

License: MIT

PyTorch Geometric implementations of GraphSAGE and GAT (Graph Attention Networks) for node classification on citation networks.

Overview

This repository contains implementations of two popular Graph Neural Network architectures:

Both models are tested on the Cora citation network dataset, where the task is to classify academic papers into different categories based on their content and citation relationships.

Results

Performance on Cora dataset (7 classes, 2708 nodes):

Model Test Accuracy Parameters Training Time
GraphSAGE 80.90% 2 layers, 64 hidden < 1 min
GAT 82.80% 2 layers, 64 hidden, 8 heads ~ 5 min

Installation

# Clone the repo
git clone https://github.com/yourusername/gnn-node-classification.git
cd gnn-node-classification

# Create a virtualenv (recommended)
python3 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt

Usage

Below are example commands to train and evaluate the GNN models. Adjust paths or hyperparameter files as needed.

1. Train GraphSAGE on Cora

python src/train.py --config configs/graphsage_cora.yaml

2. Train GAT on Cora

python src/train.py --config configs/gat_cora.yaml

Acknowledgments

Parts of this code were adapted from the Stanford CS224W “Machine Learning with Graphs” course materials:

Leskovec, Jure (Instructor). CS224W: Machine Learning with Graphs. Stanford University.
URL: https://web.stanford.edu/class/cs224w/ (accessed June 2, 2025)

About

PyTorch Geometric implementations of GraphSAGE and GAT (Graph Attention Networks) for node classification on citation networks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages