Official code of our paper "Leveraging Joint Predictive Embedding and Bayesian Inference in Graph Self Supervised Learning". The preprint can be found here.

- Create a Python(preferrably >3.10) virtual environment and activate it. Run the following command
pip install -r requirements.txt- Create a
.envfile and set the values of all environment variables. - Download datasets by running
embedding/download_data.py - To train node embeddings, run the scripts in the
embeddingfolder.train.pytrains embeddings without Bayesian Inference andtrain_gmm.pyuses Bayesian Inference. - To test the embeddings on node classification, you may run the following scripts in the
classificationdirectory: -
- Run
train_backbone_frozen.pyto train only the classifier head keeping the backbone frozen. We report these scores in our paper.
- Run
-
- Run
train.pyto update the weights of the backbone as well.
- Run
-
- Similarly
test_backbone.pyandtest.pyruns node classification tests on frozen and online backbones respectively.
- Similarly
- To test the embeddings on node clustering and plot them, run
cluster_nodes.pyin thenode_clusteringdirectory. - To perform tests such as augmenting node features with noise etc, run the
test.pyscript in theabnormal_featuresdirectory. - To perform evaluations on OOD data during test time, run the
test.pyscript in thettadirectory. - The
analysis_plotsdirectory contains node clustering results, loss curves and embedding spread plots. You may generate the plots by running the scriptsmomentum_study.pyandembedding_spread.pyin the same directory.
torch
torchvision
python-dotenv
torch-geometric
torchmetrics
pytorch-lightning
scikit-learn
numpy
scipy
python-dotenv
matplotlib
wandb
osIf there are any bugs, you may raise an issue using the standard issue template. If there are any technical questions regarding the project, you may email me at smudge0110@icloud.com.