Skip to content

GAP_Generalizable Approximate Graph Partitioning Framework_code

Notifications You must be signed in to change notification settings

XJiaoLi/GCN_Partitioning

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCN Partitioning

Graph Partitoning Using Graph Convolutional Networks as described in GAP: Generalizable Approximate Graph Partitioning Framework

Loss Backward Equations

To handle large graphs, the loss function is implemented using sparse torch tensors using a custom loss class.

If Z = (Y / \Gamma)(1 - Y)^{T} \circ A

where Y_{ij} is the probability of node i being in partition j.

L = \sum_{A_{lm} \neq 0} Z_{lm}

Then the gradients can be calculated by the equations:

\frac{\partial z_{i \alpha}}{\partial y_{ij}} = A_{i \alpha} \left(\frac{\Gamma_{j} (1 - y_{\alpha j}) - y_{ij}(1 - y_{\alpha j})D_{i}}{\Gamma_{j}^{2}}\right)

\frac{\partial z_{\alpha i}}{\partial y_{ij}} = A_{\alpha i} \left(\frac{\Gamma_{j} (- y_{\alpha j}) - y_{\alpha j}(1 - y_{ij})D_{i}}{\Gamma_{j}^{2}}\right)

\frac{\partial z_{i^{'} \alpha}}{\partial y_{ij}} = A_{i^{'} \alpha} \left(\frac{(1 - y_{\alpha j}) y_{i^{'}j}D_{i}}{\Gamma_{j}^{2}}\right) ;;; i^{'}, \alpha \neq i

Installation

Create a virtual environment using venv

python3 -m venv env

Source the virtual environment

source env/bin/activate

Use the package manager pip to install requirements.

pip install -r requirements.txt

Usage

python TrialModel.py

Limitations

Has only been tested on small custom graphs.

License

MIT

About

GAP_Generalizable Approximate Graph Partitioning Framework_code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%