All Projects → benedekrozemberczki → walklets

benedekrozemberczki / walklets

Licence: GPL-3.0 license
A lightweight implementation of Walklets from "Don't Walk Skip! Online Learning of Multi-scale Network Embeddings" (ASONAM 2017).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to walklets

RolX
An alternative implementation of Recursive Feature and Role Extraction (KDD11 & KDD12)
Stars: ✭ 52 (-44.68%)
Mutual labels:  word2vec, deepwalk, gensim, graph-mining, embedding, node2vec, graph-embedding, node-embedding
FEATHER
The reference implementation of FEATHER from the CIKM '20 paper "Characteristic Functions on Graphs: Birds of a Feather, from Statistical Descriptors to Parametric Models".
Stars: ✭ 34 (-63.83%)
Mutual labels:  deepwalk, node2vec, graph-embedding, node-classification, node-embedding, graph-convolution
FSCNMF
An implementation of "Fusing Structure and Content via Non-negative Matrix Factorization for Embedding Information Networks".
Stars: ✭ 16 (-82.98%)
Mutual labels:  word2vec, deepwalk, embedding, node2vec, graph-embedding, node-embedding
resolutions-2019
A list of data mining and machine learning papers that I implemented in 2019.
Stars: ✭ 19 (-79.79%)
Mutual labels:  deepwalk, node2vec, graph-embedding, node-classification, node-embedding
NMFADMM
A sparsity aware implementation of "Alternating Direction Method of Multipliers for Non-Negative Matrix Factorization with the Beta-Divergence" (ICASSP 2014).
Stars: ✭ 39 (-58.51%)
Mutual labels:  word2vec, deepwalk, embedding, node2vec, word-embedding
Awesome Graph Classification
A collection of important graph embedding, classification and representation learning papers with implementations.
Stars: ✭ 4,309 (+4484.04%)
Mutual labels:  deepwalk, node2vec, graph-embedding, node-embedding
Awesome Community Detection
A curated list of community detection research papers with implementations.
Stars: ✭ 1,874 (+1893.62%)
Mutual labels:  deepwalk, dimensionality-reduction, embedding, node2vec
Euler
A distributed graph deep learning framework.
Stars: ✭ 2,701 (+2773.4%)
Mutual labels:  node2vec, graph-embedding, graph-neural-networks
pymde
Minimum-distortion embedding with PyTorch
Stars: ✭ 420 (+346.81%)
Mutual labels:  dimensionality-reduction, embedding, graph-embedding
word-embeddings-from-scratch
Creating word embeddings from scratch and visualize them on TensorBoard. Using trained embeddings in Keras.
Stars: ✭ 22 (-76.6%)
Mutual labels:  word2vec, gensim
Word2VecAndTsne
Scripts demo-ing how to train a Word2Vec model and reduce its vector space
Stars: ✭ 45 (-52.13%)
Mutual labels:  word2vec, gensim
Pro-GNN
Implementation of the KDD 2020 paper "Graph Structure Learning for Robust Graph Neural Networks"
Stars: ✭ 202 (+114.89%)
Mutual labels:  graph-mining, graph-neural-networks
Aravec
AraVec is a pre-trained distributed word representation (word embedding) open source project which aims to provide the Arabic NLP research community with free to use and powerful word embedding models.
Stars: ✭ 239 (+154.26%)
Mutual labels:  word2vec, gensim
Gemsec
The TensorFlow reference implementation of 'GEMSEC: Graph Embedding with Self Clustering' (ASONAM 2019).
Stars: ✭ 210 (+123.4%)
Mutual labels:  word2vec, gensim
fastwalk
A multi-thread implementation of node2vec random walk.
Stars: ✭ 24 (-74.47%)
Mutual labels:  embedding, node2vec
Shallowlearn
An experiment about re-implementing supervised learning models based on shallow neural network approaches (e.g. fastText) with some additional exclusive features and nice API. Written in Python and fully compatible with Scikit-learn.
Stars: ✭ 196 (+108.51%)
Mutual labels:  word2vec, gensim
SimP-GCN
Implementation of the WSDM 2021 paper "Node Similarity Preserving Graph Convolutional Networks"
Stars: ✭ 43 (-54.26%)
Mutual labels:  graph-mining, graph-neural-networks
doc2vec-api
document embedding and machine learning script for beginners
Stars: ✭ 92 (-2.13%)
Mutual labels:  word2vec, gensim
Germanwordembeddings
Toolkit to obtain and preprocess german corpora, train models using word2vec (gensim) and evaluate them with generated testsets
Stars: ✭ 189 (+101.06%)
Mutual labels:  word2vec, gensim
GE-FSG
Graph Embedding via Frequent Subgraphs
Stars: ✭ 39 (-58.51%)
Mutual labels:  word2vec, graph-embedding

Walklets

Arxiv codebeat badge repo size benedekrozemberczki

Abstract

We present Walklets, a novel approach for learning multiscale representations of vertices in a network. In contrast to previous works, these representations explicitly encode multiscale vertex relationships in a way that is analytically derivable. Walklets generates these multiscale relationships by subsampling short random walks on the vertices of a graph. By `skipping' over steps in each random walk, our method generates a corpus of vertex pairs which are reachable via paths of a fixed length. This corpus can then be used to learn a series of latent representations, each of which captures successively higher order relationships from the adjacency matrix. We demonstrate the efficacy of Walklets's latent representations on several multi-label network classification tasks for social networks such as BlogCatalog, DBLP, Flickr, and YouTube. Our results show that Walklets outperforms new methods based on neural matrix factorization. Specifically, we outperform DeepWalk by up to 10% and LINE by 58% Micro-F1 on challenging multi-label classification tasks. Finally, Walklets is an online algorithm, and can easily scale to graphs with millions of vertices and edges.

The implementation supports second-order random walk sampling, which was proposed in the original paper but was not implemented in it. The second-order random walks sampling methods were taken from the reference implementation of Node2vec.

This repository provides an implementation of Walklets as described in the paper:

Don't Walk, Skip! Online Learning of Multi-scale Network Embeddings. Bryan Perozzi, Vivek Kulkarni, Haochen Chen, Steven Skiena. ASONAM, 2017. https://arxiv.org/abs/1605.02115


The model is now also available in the package Karate Club.

A C++ implementation of Walklets is available [here].

Requirements

The codebase is implemented in Python 3.5.2 | Anaconda 4.2.0 (64-bit). Package versions used for development are just below.

tqdm              4.28.1
numpy             1.15.4
pandas            0.23.4
texttable         1.5.0
gensim            3.6.0
networkx          2.4

Datasets

The code takes an input graph in a csv file. Every row indicates an edge between two nodes separated by a comma. The first row is a header. Nodes should be indexed starting with 0. Sample graphs for the `Facebook Politicians` and `Facebook Food` datasets are included in the `input/` directory.

Options

Learning of the embedding is handled by the src/embedding_clustering.py script which provides the following command line arguments.

Input and output options

  --input  STR           Input graph path.    Default is `input/food_edges.csv`.
  --output STR           Embeddings path.     Default is `output/food_embedding.csv`.

Model options

  --dimensions  INT      Number of dimensions.                               Default is 16.
  --walk-length INT      Length of random walk per source.                   Default is 80.
  --walk-number INT      Number of random walks per source.                  Default is 5.
  --window-size INT      Window size for proximity statistic extraction.     Default is 5. 
  --min-count   INT      Minimal number of appeareances is to be kept.       Default is 1.
  --workers     INT      Number of cores used for optimization.              Default is 4. 
  --walk-type   STR      Order of random walk.                               Default is `first`.
  --P           FLOAT    Return hyperparameter for second-order walk.        Default is 1.0.
  --Q           FLOAT    In-out hyperparameter for second-order walk.        Default is 1.0.   

Examples

The following commands learn a graph embedding and writes these to disk. The node representations are ordered by the ID.

Creating a Walklet embedding of the default dataset with the default hyperparameter settings. Saving the embedding, cluster centres and the log file at the default path.

$ python src/main.py

Creating an embedding of an other dataset the Facebook Politicians. Saving the output and the log in a custom place.

$ python src/main.py --input input/politicians_edges.csv  --output output/politician_embedding.csv

Creating an embedding of the default dataset in 32 dimensions, 20 sequences per source node with length 160.

$ python src/main.py --dimensions 32 --walk-number 20 --walk-length 160 

Creating an embedding of the default dataset in 32 dimensions, 20 sequences per source node with length 160. We use second-order random walk sampling with a custom random walk behaviour setting.

$ python src/main.py --dimensions 32 --walk-number 20 --walk-length 160 --walk-type second --P 4 --Q 0.25

License


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].