Skip to content

wenzhilics/HomoGCL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HomoGCL: Rethinking Homophily in Graph Contrastive Learning

Implementation of KDD'23 paper HomoGCL: Rethinking Homophily in Graph Contrastive Learning.

Requirements

This repository has been tested with the following packages:

  • Python == 3.8.12
  • PyTorch == 1.11.0
  • DGL == 0.8.2
  • faiss == 1.7.2

Important Hyperparameters

  • dataname: Name of the dataset. Could be one of [cora, citeseer, pubmed, photo, comp]. The datasets will be downloaded automatically to ~/.dgl/ when run the code for the first time.
  • nclusters:Number of clusters (centroids) in k-means. Default is 5.
  • alpha: Weight coefficient between contrastive loss and homophily loss. Default is 1.
  • lr1: Learning rate for HomoGCL.
  • lr2: Learning rate for linear evaluator.
  • der: Edge drop rate. Default is 0.4.
  • dfr: Feature drop rate. Default is 0.1.
  • clustering: Whether to do the downstream node clustering task. Default is False.

Please refer to args.py for the full hyper-parameters.

How to Run

Pass the above parameters to main.py. For example:

# cora
python main.py --dataname cora --nclusters 10 --alpha 1 --epoch1 50 --mean --epoch2 1000
# citeseer
python main.py --dataname citeseer --nclusters 30 --alpha 1 --epoch1 40 --epoch2 500
# pubmed
python main.py --dataname pubmed --nclusters 10 --alpha 1 --epoch1 100 --epoch2 500
# photo
python main.py --dataname photo --nclusters 10 --alpha 1 --epoch1 50 --lr1 1e-4 --epoch2 5000 --lr2 1e-3 --proj_dim 64
# computer
python main.py --dataname comp --nclusters 30 --alpha 1 --epoch1 100 --lr1 1e-4 --epoch2 5000 --lr2 1e-3

Acknowledgements

The code is implemented based on CCA-SSG.

Citation

If you find this work is helpful to your research, please consider citing our paper:

@article{li2023homogcl,
  title={HomoGCL: Rethinking Homophily in Graph Contrastive Learning},
  author={Wen-Zhi Li and Chang-Dong Wang and Hui Xiong and Jian-Huang Lai},
  journal={arXiv preprint arXiv:2306.09614},
  year={2023}
}

About

"HomoGCL: Rethinking Homophily in Graph Contrastive Learning" in KDD'23

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages