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].
Owner
Andrew Davison
Andrew Davison
The materials used in the SaxonJS tutorial presented at Declarative Amsterdam, 2021

SaxonJS-Tutorial-2021, version 1.0.4 Last updated on 4 November, 2021. Table of contents Background Prerequisites Starting a web server Running a Java

Saxonica 11 Oct 23, 2022
YOLOV4运行在嵌入式设备上

在嵌入式设备上实现YOLO V4 tiny 在嵌入式设备上实现YOLO V4 tiny 目录结构 目录结构 |-- YOLO V4 tiny |-- .gitignore |-- LICENSE |-- README.md |-- test.txt |-- t

Liu-Wei 6 Sep 09, 2021
A texturizer that I just made. Nothing special here.

texturizer This is a little project that I did with an hour's time. It texturizes an image given a image and a texture to texturize it with. There is

1 Nov 11, 2021
FedGS: A Federated Group Synchronization Framework Implemented by LEAF-MX.

FedGS: Data Heterogeneity-Robust Federated Learning via Group Client Selection in Industrial IoT Preparation For instructions on generating data, plea

Lizonghang 9 Dec 22, 2022
The official implementation of A Unified Game-Theoretic Interpretation of Adversarial Robustness.

This repository is the official implementation of A Unified Game-Theoretic Interpretation of Adversarial Robustness. Requirements pip install -r requi

Jie Ren 17 Dec 12, 2022
Code repository accompanying the paper "On Adversarial Robustness: A Neural Architecture Search perspective"

On Adversarial Robustness: A Neural Architecture Search perspective Preparation: Clone the repository: https://github.com/tdchaitanya/nas-robustness.g

Chaitanya Devaguptapu 4 Nov 10, 2022
Continuous Diffusion Graph Neural Network

We present Graph Neural Diffusion (GRAND) that approaches deep learning on graphs as a continuous diffusion process and treats Graph Neural Networks (GNNs) as discretisations of an underlying PDE.

Twitter Research 227 Jan 05, 2023
a short visualisation script for pyvideo data

PyVideo Speakers A CLI that visualises repeat speakers from events listed in https://github.com/pyvideo/data Not terribly efficient, but you know. Ins

Katie McLaughlin 3 Nov 24, 2021
Cognition-aware Cognate Detection

Cognition-aware Cognate Detection The repository which contains our code for our EACL 2021 paper titled, "Cognition-aware Cognate Detection". This wor

Prashant K. Sharma 1 Feb 01, 2022
Supervised Classification from Text (P)

MSc-Thesis Module: Masters Research Thesis Language: Python Grade: 75 Title: An investigation of supervised classification of therapeutic process from

Matthew Laws 1 Nov 22, 2021
Deep Illuminator is a data augmentation tool designed for image relighting. It can be used to easily and efficiently generate a wide range of illumination variants of a single image.

Deep Illuminator Deep Illuminator is a data augmentation tool designed for image relighting. It can be used to easily and efficiently generate a wide

George Chogovadze 52 Nov 29, 2022
Tandem Mass Spectrum Prediction with Graph Transformers

MassFormer This is the original implementation of MassFormer, a graph transformer for small molecule MS/MS prediction. Check out the preprint on arxiv

Röst Lab 13 Oct 27, 2022
The first dataset of composite images with rationality score indicating whether the object placement in a composite image is reasonable.

Object-Placement-Assessment-Dataset-OPA Object-Placement-Assessment (OPA) is to verify whether a composite image is plausible in terms of the object p

BCMI 53 Nov 15, 2022
An efficient implementation of GPNN

Efficient-GPNN An efficient implementation of GPNN as depicted in "Drop the GAN: In Defense of Patches Nearest Neighbors as Single Image Generative Mo

7 Apr 16, 2022
HyDiff: Hybrid Differential Software Analysis

HyDiff: Hybrid Differential Software Analysis This repository provides the tool and the evaluation subjects for the paper HyDiff: Hybrid Differential

Yannic Noller 22 Oct 20, 2022
Twins: Revisiting the Design of Spatial Attention in Vision Transformers

Twins: Revisiting the Design of Spatial Attention in Vision Transformers Very recently, a variety of vision transformer architectures for dense predic

482 Dec 18, 2022
A Dynamic Residual Self-Attention Network for Lightweight Single Image Super-Resolution

DRSAN A Dynamic Residual Self-Attention Network for Lightweight Single Image Super-Resolution Karam Park, Jae Woong Soh, and Nam Ik Cho Environments U

4 May 10, 2022
Code for our ICCV 2021 Paper "OadTR: Online Action Detection with Transformers".

Code for our ICCV 2021 Paper "OadTR: Online Action Detection with Transformers".

66 Dec 15, 2022
Warning: This project does not have any current developer. See bellow.

Pylearn2: A machine learning research library Warning : This project does not have any current developer. We will continue to review pull requests and

Laboratoire d’Informatique des Systèmes Adaptatifs 2.7k Dec 26, 2022
Scalable Graph Neural Networks for Heterogeneous Graphs

Neighbor Averaging over Relation Subgraphs (NARS) NARS is an algorithm for node classification on heterogeneous graphs, based on scalable neighbor ave

Facebook Research 67 Dec 03, 2022