https://github.com/amazon-science/dual-channel-hypergraph-neural-network

https://github.com/amazon-science/dual-channel-hypergraph-neural-network

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: amazon-science
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 176 KB
Statistics
  • Stars: 12
  • Watchers: 6
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 3 years ago · Last pushed over 3 years ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Search Behavior Prediction: A Hypergraph Perspective

Yan Han, Eddie Huang, Wenqing Zheng, Nikhil Rao, Zhangyang Wang, Karthik Subbian.

Dual-Channel Attention-based Hypergraph Neural Network (DCAH)

DCAH

This framework utilizes the free-available auxiliary information to create a hypergraph to assist the main task of link prediction.

Environment Setup

We recommend you to create a conda environment:

conda create -n <myenv> python=3.7 conda activate <myenv> conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch conda install pyg -c pyg pip install ogb==1.3.3

If any above command fails, we also attached an enviroment.yml file to create the environment:

conda env create -f environment.yml conda activate <myenv>

The first line of the yml file sets the new environment's name, it can be changed manually to any name you want.

Dataset Preprocessing

Since the e-commerce dataset used in this paper is proprietary, we only share the public dataset preprocessing. Please modify the save path when running the following script. Here we provide two examples. The first one is ogb-citation dataset, the node represents the paper and the link represents the citation relationship between two papers. The auxiliary information here is the topics of the papers, which can be represented as a hypergraph by clustering the papers of the same topic, the prior here is that the papers of the same topic are more likely to cite each other. The second one is ogb-collaboration dataset, the node represents the author and the link represents the co-authorship relationship between two authors. The auxiliary information here is the instituations of the authors, which can be represented as a hypergraph by clustering the authors of the same instituation, the prior here is that the authors of the same instituation are more likely to colloaborate.

python preprocess_ogb.py --save_path <your own path> --sampled_authors <50000>

The above command will generate four graphs (two normal graphs + two hypergraphs), both in the format of edge_index array. Note that for ogb-collaboration graph, since the original graph is huge, which is hard to be loaded in a single GPU, it needs to be sampled.

Pre-Train

Pre-train a DCAH via contrastive learning

python pretrain.py --data_name <citation or collaboration> --epochs 200 --encoder dual

Note: Remember to create a folder to save the model checkpoints, and replace the save path of the script.

Finetune or Train from Scratch

Finetune a pre-trained DCAH on a downstream task

python trainer_link_prediction.py --data_name <citation or collaboration> --encoder dual --load <checkpoints path> --eval_metric <mrr or recall_my@1>

Train a DCAH from scratch

python trainer_link_prediction.py --data_name <citation or collaboration> --encoder dual --eval_metric <mrr or recall_my@1>

Train from Scratch using DropEdge

python trainer_link_prediction.py --data_name <citation or collaboration> --encoder dual --eval_metric <mrr or recall_my@1> --use_drop_edge True

Owner

  • Name: Amazon Science
  • Login: amazon-science
  • Kind: organization

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

environment.yml pypi
  • cycler ==0.11.0
  • fonttools ==4.37.1
  • jinja2 ==3.1.2
  • joblib ==1.1.0
  • keopscore ==2.1
  • kiwisolver ==1.4.4
  • littleutils ==0.2.2
  • markupsafe ==2.1.1
  • matplotlib ==3.5.3
  • networkx ==2.6.3
  • numpy ==1.21.6
  • ogb ==1.3.3
  • outdated ==0.2.1
  • packaging ==21.3
  • pandas ==1.3.5
  • pybind11 ==2.10.0
  • pykeops ==2.1
  • pyparsing ==3.0.9
  • python-dateutil ==2.8.2
  • pytz ==2022.2.1
  • scikit-learn ==1.0.2
  • scipy ==1.7.3
  • threadpoolctl ==3.1.0
  • torch-cluster ==1.6.0
  • torch-geometric ==2.1.0.post1
  • torch-scatter ==2.0.9
  • torch-sparse ==0.6.15
  • torch-spline-conv ==1.2.1
  • tqdm ==4.64.1