Skip to content

doblerk/deep-graph-matching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GNN-GED Framework

This repository contains an implementation of a GNN-based framework to derive graph edit operations.

Folder structure

├── data
│   └── TUDataset
│       └── MUTAG
│           └── raw
│
├── gnnged
│   ├── assignment
│   ├── edit_cost
│   ├── evaluation
|   ├── heuristics
│   ├── models
│   ├── training
│   └── utils
│
├── scripts
|
├── src
│   └── build
│ 
├── res
│   └── MUTAG
│       └── GIN
│           └── raw
│
├── tests
└── venv

Installation

Prerequisites

  • Python >= 3.10
  • PyTorch & torch-geometric (see installation below)

Install

# 1. Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# 2. Install PyTorch and torch-geometric (CUDA 12.4 shown, adjust if needed)
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
pip3 install torch_geometric

# Install the package in editable/development mode
python3 -m pip install -e .

Usage

Run scripts with JSON parameter files

{
    "dataset_dir": "data/TUDataset",
    "dataset_name": "MUTAG",
    "output_dir": "./res/MUTAG/",
    "use_attrs": false,
}

Split the data set

# Split the data set
python3 scripts/run_preprocessing.py

Train a GNN model

# Finetune the model
python3 scripts/run_finetuning.py

# Train the model
python3 scripts/run_training.py

Compute GED

# Compute distances
python3 scripts/run_matching.py

Classify graphs

# Classify graphs
python3 scripts/run_evaluation.py

Further information

Please refer to Graph Matching for a faster alternative.

About

A GNN-based framework to derive Graph Edit Distance edit operations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published