Git Product home page Git Product logo

shglnn's Introduction

SHGLNN

Self-supervised Heterogeneous Hypergraph Learning with Context-aware Pooling for Graph-level Classification

SHGLNN is an algorithm for graph embeddings, harnessing the power of hypergraphs for intra and inter-graph contexts. This repository provides the code implementation of the algorithm as described in the paper.

Algorithm Overview

The algorithm receives a set of graphs and processes them in batches through a specified number of epochs. It leverages intra-graph hyperedges, inter-graph hyperedges, type-specific node and hyperedge attentions, and contrastive loss to generate embeddings for the input graphs.

See Algorithm 1 in our paper for a detailed step-by-step explanation.

Code Structure

Core Files:

  • kMatrix.py: Responsible for generating k-specific matrices corresponding to intra-graph hyperedges.
  • sMatrix.py: Generates matrix pertaining to inter-graph hyperedges.
  • hypergraphGen.py: Constructs hypergraph using the intra and inter-graph hyperedges.
  • dataset_loader.py: Helper functions to load and preprocess the datasets.
  • layers.py: Contains various neural network layers utilized in the model - node convolution, hyperedge convolution, context-aware graph-level pooling
  • model.py: Defines the main SHGLNN neural network model.
  • train.py: Orchestrates the training process of the algorithm, including the calculation of contrastive loss and back propagation.

Prerequisites

  • Python 3.8 or above
  • PyTorch Geometric 2.4.0
  • NumPy 1.26.0
  • NetworkX 3.1
  • HypernetX 2.0.5

Datasets

We use the TUDatasets mentioned in the paper from PyTorch Geometric TUDatasets (https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.datasets.TUDataset.html#torch_geometric.datasets.TUDataset)

Usage

  1. Clone the repository git clone https://github.com/YOUR_USERNAME/SHGLNN.git cd SHGLNN
  2. Install the required packages/libraries: pip install numpy networkx hypernetx
  3. Generate the matrices K and S for intra- and inter-graph hyperedges
    • Note that for all datasets, multiple K matrices would be generated as we go through different values of K. However, we will generate a single S matrix for each dataset.
  4. Generate hypergraph using hypergraphGen.py
  5. Develop layers using layers.py
  6. Run the model.py to develop the model
  7. Then, train the model using train.py
    • Note that for datasets, we used the built-in TU dataset from PyTorch Geometric

Contribution

Pull requests are welcome. For major changes or any issues, please open an issue first for discussion. For further inquiries, contact the first author at [email protected] or [email protected].

License

MIT

Citation

If you use this work, please cite the following:

@inproceedings{hayatSHGLNN2023, 
    author = {Hayat, Malik Khizar, Xue, Shan and Yang, Jian},
    title = {Self-supervised Heterogeneous Hypergraph Learning with Context-aware Pooling for Graph-level Classification},
    booktitle = {ICDM},
    year = {2023},
    pages=---,
    doi={---},
}

shglnn's People

Contributors

khizer-hayat avatar

Stargazers

jiang jinkun avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.