Bootstrap Latents of Nodes and Neighbors for Graph Self-Supervised Learning

June 5, 2024 · View on GitHub

Official Implementation of Bootstrap Latents of Nodes and Neighbors for Graph Self-Supervised Learning (ECML-PKDD 2024).

Abstract

Overview of BLNN

Figure 1: Overview of our proposed BLNN method. Given a graph, we first generate two different views using augmentations t1,t2t^1,t^2. From these, we use encoders fθ,fϕf_{\theta}, f_\phi to form online and target node representations H1,H2\boldsymbol{H}^1, \boldsymbol{H}^2. They are then fed into the attention module to compute the supportiveness wjw_j of the neighbor vjv_j w.r.t. the anchor node viv_i. The predictor pθp_\theta uses H1\boldsymbol{H}^1 to form a prediction Z1\boldsymbol{Z}^1 of the target H2\boldsymbol{H}^2. The final objective is computed as a combination of the alignment of node-itself pairs and the supportiveness-weighted alignment of node-neighbor pairs. Note that the alignment is achieved by maximizing the cosine similarity between corresponding rows of Z1\boldsymbol{Z}^1 and H2\boldsymbol{H}^2, flowing gradients only through Z1\boldsymbol{Z}^1. The target parameters ϕ\phi are updated as an exponentially moving average of θ\theta.

Dependencies

  • torch
  • torch_scatter
  • torch_geometric

Training

All the configuration files can be found in config. And use the following command to train on the Computer dataset:

python train.py --flagfile=config/amazon-computers.cfg

Flags can be overwritten:

python train.py --flagfile=config/amazon-computers.cfg --tau=1.0

Acknowledgements

The code is implemented based on bgrl.

Citation

If you find the code useful for your research, please consider citing our work:

@inproceedings{liu2024bootstrap,
  title={Bootstrap Latents of Nodes and Neighbors for Graph Self-Supervised Learning},
  author={Liu, Yunhui and Zhang, Huaisong and He, Tieke and Zheng, Tao and Zhao, Jianhua},
  booktitle={Joint European Conference on Machine Learning and Knowledge Discovery in Databases},
  year={2024},
  organization={Springer}
}