Heterogeneous MPNN
This repository contains implementation of a heterogeneous version of the GNN method MPNN (H-MPNN) from the “Neural Message Passing for Quantum Chemistry” paper.
The implementation is used in the "Finding Money Launderers Using Heterogeneous Graph" paper.
It is implemented using the "PyTorch Geometric" library.
The repository provides a running code example on a small publically available dataset to illustrate its use.
The notebook train_model.ipynb
contains the running code-example.
The implementation of H-MPNN for 1-4 layers is in models_hmct.py
.
Creating Conda Environment
Below are instructions to create a conda environment to run train_model.ipynb
in Jupyter Notebook.
- Create a conda environment named gnn_env:
conda create -n gnn_env python=3.9
- Activate the environment:
conda activate gnn_env
- Install Black formatter:
pip install jupyter-black jupyter
- Install PyTorch and dependencies:
conda install pyg -c pyg
- Install pandas, matplotlib and Iphkernel:
conda install pandas matplotlib ipykernel
- Add the virtual environment to jupyter:
python -m ipykernel install --user --name=gnn_env
Remove Conda Environment
First deactivate conda environment:conda deactivate
.
Remove conda enviroment with conda env remove -n gnn_env
and the jupyter kerlen with jupyter kernelspec uninstall gnn_env