Code for the paper "Asymptotics of ℓ2 Regularized Network Embeddings"

Overview

README

Code for the paper Asymptotics of L2 Regularized Network Embeddings.

Requirements

Requires Stellargraph 1.2.1, Tensorflow 2.6.0, scikit-learm 0.24.1, tqdm, along with any other packages required for the above three packages.

Code

To run node classification or link prediction experiments, run

python -m code.train_embed [[args]]

or

python -m code.train_embed_link [[args]]

from the command line respectively, where [[args]] correspond to the command line arguments for each function. Note that the scripts expect to run from the parent directory of the code folder; you will need to change the import statements in the associated python files if you move them around. The -h command line argument will display the arguments (with descriptions) of each of the two files.

train_embed.py arguments

short long default help
-h --help show this help message and exit
--dataset Cora Dataset to perform training on. Available options: Cora,CiteSeer,PubMedDiabetes
--emb-size 128 Embedding dimension. Defaults to 128.
--reg-weight 0.0 Weight to use for L2 regularization. If norm_reg is True, then reg_weight/num_of_nodes is used instead.
--norm-reg Boolean for whether to normalize the L2 regularization weight by the number of nodes in the graph. Defaults to false.
--method node2vec Algorithm to perform training on. Available options: node2vec,GraphSAGE,GCN,DGI
--verbose 1 Level of verbosity. Defaults to 1.
--epochs 5 Number of epochs through the dataset to be used for training.
--optimizer Adam Optimization algorithm to use for training.
--learning-rate 0.001 Learning rate to use for optimization.
--batch-size 64 Batch size used for training.
--train-split [0.01, 0.025, 0.05] Percentage(s) to use for the training split when using the learned embeddings for downstream classification tasks.
--train-split-num 25 Decides the number of random training/test splits to use for evaluating performance. Defaults to 50.
--output-fname None If not None, saves the hyperparameters and testing results to a .json file with filename given by the argument.
--node2vec-p 1.0 Hyperparameter governing probability of returning to source node.
--node2vec-q 1.0 Hyperparameter governing probability of moving to a node away from the source node.
--node2vec-walk-number 50 Number of walks used to generate a sample for node2vec.
--node2vec-walk-length 5 Walk length to use for node2vec.
--dgi-sampler fullbatch Specifies either a fullbatch or a minibatch sampling scheme for DGI.
--gcn-activation ['relu'] Determines the activations of each layer within a GCN. Defaults to a single layer with relu activation.
--graphSAGE-aggregator mean Specifies the aggreagtion rule used in GraphSAGE. Defaults to mean pooling.
--graphSAGE-nbhd-sizes [10, 5] Specify multiple neighbourhood sizes for sampling in GraphSAGE. Defaults to [10, 5].
--tensorboard If toggles, saves Tensorboard logs for debugging purposes.
--visualize-embeds None If specified with a directory, saves an image of a TSNE 2D projection of the learned embeddings at the specified directory.
--save-spectrum None If specifies, saves the spectrum of the learned embeddings output by the algorithm.

train_embed_link.py arguments

short long default help
-h --help show this help message and exit
--dataset Cora Dataset to perform training on. Available options: Cora,CiteSeer,PubMedDiabetes
--emb-size 128 Embedding dimension. Defaults to 128.
--reg-weight 0.0 Weight to use for L2 regularization. If norm_reg is True, then reg_weight/num_of_nodes is used instead.
--norm-reg Boolean for whether to normalize the L2 regularization weight by the number of nodes in the graph. Defaults to false.
--method node2vec Algorithm to perform training on. Available options: node2vec,GraphSAGE,GCN,DGI
--verbose 1 Level of verbosity. Defaults to 1.
--epochs 5 Number of epochs through the dataset to be used for training.
--optimizer Adam Optimization algorithm to use for training.
--learning-rate 0.001 Learning rate to use for optimization.
--batch-size 64 Batch size used for training.
--test-split 0.1 Split of edge/non-edge set to be used for testing.
--output-fname None If not None, saves the hyperparameters and testing results to a .json file with filename given by the argument.
--node2vec-p 1.0 Hyperparameter governing probability of returning to source node.
--node2vec-q 1.0 Hyperparameter governing probability of moving to a node away from the source node.
--node2vec-walk-number 50 Number of walks used to generate a sample for node2vec.
--node2vec-walk-length 5 Walk length to use for node2vec.
--gcn-activation ['relu'] Specifies layers in terms of their output activation (either relu or linear), with the number of arguments determining the length of the GCN. Defaults to a single layer with relu activation.
--graphSAGE-aggregator mean Specifies the aggreagtion rule used in GraphSAGE. Defaults to mean pooling.
--graphSAGE-nbhd-sizes [10, 5] Specify multiple neighbourhood sizes for sampling in GraphSAGE. Defaults to [25, 10].
You might also like...
PyTorch code for the paper: FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning
PyTorch code for the paper: FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning

FeatMatch: Feature-Based Augmentation for Semi-Supervised Learning This is the PyTorch implementation of our paper: FeatMatch: Feature-Based Augmentat

Code for the paper A Theoretical Analysis of the Repetition Problem in Text Generation
Code for the paper A Theoretical Analysis of the Repetition Problem in Text Generation

A Theoretical Analysis of the Repetition Problem in Text Generation This repository share the code for the paper "A Theoretical Analysis of the Repeti

Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks
Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks

SA-Net: Shuffle Attention for Deep Convolutional Neural Networks (paper) By Qing-Long Zhang and Yu-Bin Yang [State Key Laboratory for Novel Software T

Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Code for the Shortformer model, from the paper by Ofir Press, Noah A. Smith and Mike Lewis.

Shortformer This repository contains the code and the final checkpoint of the Shortformer model. This file explains how to run our experiments on the

PyTorch code for ICLR 2021 paper Unbiased Teacher for Semi-Supervised Object Detection
PyTorch code for ICLR 2021 paper Unbiased Teacher for Semi-Supervised Object Detection

Unbiased Teacher for Semi-Supervised Object Detection This is the PyTorch implementation of our paper: Unbiased Teacher for Semi-Supervised Object Detection

Official code for paper "Optimization for Oriented Object Detection via Representation Invariance Loss".

Optimization for Oriented Object Detection via Representation Invariance Loss By Qi Ming, Zhiqiang Zhou, Lingjuan Miao, Xue Yang, and Yunpeng Dong. Th

Code for our CVPR 2021 paper
Code for our CVPR 2021 paper "MetaCam+DSCE"

Joint Noise-Tolerant Learning and Meta Camera Shift Adaptation for Unsupervised Person Re-Identification (CVPR'21) Introduction Code for our CVPR 2021

Code for our CVPR2021 paper coordinate attention
Code for our CVPR2021 paper coordinate attention

Coordinate Attention for Efficient Mobile Network Design (preprint) This repository is a PyTorch implementation of our coordinate attention (will appe

Owner
Andrew Davison
Andrew Davison
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
Code for paper ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization in the Loop.

Who Left the Dogs Out? Evaluation and demo code for our ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization

Benjamin Biggs 29 Dec 28, 2022
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

null 73 Nov 6, 2022
Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

CoProtector Code for the prototype tool in our paper "CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning".

Zhensu Sun 1 Oct 26, 2021
Code to use Augmented Shapiro Wilks Stopping, as well as code for the paper "Statistically Signifigant Stopping of Neural Network Training"

This codebase is being actively maintained, please create and issue if you have issues using it Basics All data files are included under losses and ea

J K Terry 32 Nov 9, 2021
Code for our method RePRI for Few-Shot Segmentation. Paper at http://arxiv.org/abs/2012.06166

Region Proportion Regularized Inference (RePRI) for Few-Shot Segmentation In this repo, we provide the code for our paper : "Few-Shot Segmentation Wit

Malik Boudiaf 138 Dec 12, 2022
Code for ACM MM 2020 paper "NOH-NMS: Improving Pedestrian Detection by Nearby Objects Hallucination"

NOH-NMS: Improving Pedestrian Detection by Nearby Objects Hallucination The offical implementation for the "NOH-NMS: Improving Pedestrian Detection by

Tencent YouTu Research 64 Nov 11, 2022
Official TensorFlow code for the forthcoming paper

~ Efficient-CapsNet ~ Are you tired of over inflated and overused convolutional neural networks? You're right! It's time for CAPSULES :)

Vittorio Mazzia 203 Jan 8, 2023
This is the code for the paper "Contrastive Clustering" (AAAI 2021)

Contrastive Clustering (CC) This is the code for the paper "Contrastive Clustering" (AAAI 2021) Dependency python>=3.7 pytorch>=1.6.0 torchvision>=0.8

Yunfan Li 210 Dec 30, 2022
Code for the paper Learning the Predictability of the Future

Learning the Predictability of the Future Code from the paper Learning the Predictability of the Future. Website of the project in hyperfuture.cs.colu

Computer Vision Lab at Columbia University 139 Nov 18, 2022