All Projects β†’ xgfs β†’ Verse

xgfs / Verse

Licence: mit
Reference implementation of the paper VERSE: Versatile Graph Embeddings from Similarity Measures

Projects that are alternatives of or similar to Verse

Deepwalk C
DeepWalk implementation in C++
Stars: ✭ 88 (-10.2%)
Mutual labels:  graph, graph-algorithms
C Sharp Algorithms
πŸ“š πŸ“ˆ Plug-and-play class-library project of standard Data Structures and Algorithms in C#
Stars: ✭ 4,684 (+4679.59%)
Mutual labels:  graph, graph-algorithms
Vivagraphjs
Graph drawing library for JavaScript
Stars: ✭ 3,442 (+3412.24%)
Mutual labels:  graph, graph-algorithms
Javascript Datastructures Algorithms
πŸ“š collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
Stars: ✭ 3,221 (+3186.73%)
Mutual labels:  graph, graph-algorithms
Node2vec
Implementation of the node2vec algorithm.
Stars: ✭ 654 (+567.35%)
Mutual labels:  machine-learning-algorithms, embeddings
Rgl
RGL is a framework for graph data structures and algorithms in Ruby.
Stars: ✭ 279 (+184.69%)
Mutual labels:  graph, graph-algorithms
Competitive coding
This repository contains some useful codes, techniques, algorithms and problem solutions helpful in Competitive Coding.
Stars: ✭ 393 (+301.02%)
Mutual labels:  graph, graph-algorithms
Grakn
TypeDB: a strongly-typed database
Stars: ✭ 2,947 (+2907.14%)
Mutual labels:  graph, graph-algorithms
Lightgraphs.jl
An optimized graphs package for the Julia programming language
Stars: ✭ 611 (+523.47%)
Mutual labels:  graph, graph-algorithms
Swiftgraph
A Graph Data Structure in Pure Swift
Stars: ✭ 588 (+500%)
Mutual labels:  graph, graph-algorithms
HuaweiCodeCraft2020
2020εŽδΈΊθ½―δ»Άη²Ύθ‹±ζŒ‘ζˆ˜θ΅›
Stars: ✭ 14 (-85.71%)
Mutual labels:  graph-algorithms, machine-learning-algorithms
Leaderboardx
A tool for building graphs quickly
Stars: ✭ 13 (-86.73%)
Mutual labels:  graph, graph-algorithms
RioGNN
Reinforced Neighborhood Selection Guided Multi-Relational Graph Neural Networks
Stars: ✭ 46 (-53.06%)
Mutual labels:  graph-algorithms, machine-learning-algorithms
Ngraph.graph
Graph data structure in JavaScript
Stars: ✭ 295 (+201.02%)
Mutual labels:  graph, graph-algorithms
Graph Data Science
Source code for the Neo4j Graph Data Science library of graph algorithms.
Stars: ✭ 251 (+156.12%)
Mutual labels:  graph, graph-algorithms
Communities
Library of community detection algorithms and visualization tools
Stars: ✭ 348 (+255.1%)
Mutual labels:  graph, graph-algorithms
Quiver
A reasonable library for modeling multi-graphs in Scala
Stars: ✭ 195 (+98.98%)
Mutual labels:  graph, graph-algorithms
Yfiles For Html Demos
Contains demo sources for the JavaScript diagramming library yFiles for HTML
Stars: ✭ 202 (+106.12%)
Mutual labels:  graph, graph-algorithms
Littleballoffur
Little Ball of Fur - A graph sampling extension library for NetworKit and NetworkX (CIKM 2020)
Stars: ✭ 505 (+415.31%)
Mutual labels:  graph, graph-algorithms
Fxgraphalgorithmsimulator
Visualizes specific Graph Algorithms like BFS, DFS, MST etc. on interactive user input graphs.
Stars: ✭ 22 (-77.55%)
Mutual labels:  graph, graph-algorithms

VERSE: Versatile Graph Embeddings from Similarity Measures

This repository provides a reference implementation of VERSE as well as links to the data.

Installation and usage

We make VERSE available in two forms: fast, optimized C++ code that was used in the experiments, and more convenient python wrapper. Note that wrapper is still experimental and may not provide optimal performance.

For C++ executables:

cd src && make;

should be enough on most platforms. If you need to change the default compiler (i.e. to Intel), use:

make CXX=icpc

VERSE is able to encompass diverse similarity measures under its model. For performance reasons, we have implemented three different similarities separately.

Use the command

verse -input data/karate.bcsr -output karate.bin -dim 128 -alpha 0.85 -threads 4 -nsamples 3

to run the default version (that corresponds to PPR similarity) with 128 embedding dimension, PPR alpha 0.85, using 3 negative samples.

Graph file format

This implementation uses a custom graph format, namely binary compressed sparse row (BCSR) format for efficiency and reduced memory usage. Converter for three common graph formats (MATLAB sparse matrix, adjacency list, edge list) can be found in the python directory of the project. Usage:

$ convert-bcsr --help
Usage: convert-bcsr [OPTIONS] INPUT OUTPUT

  Converter for three common graph formats (MATLAB sparse matrix, adjacency
  list, edge list) can be found in the root directory of the project.

Options:
  --format [mat|edgelist|weighted_edgelist|adjlist]
                                  File format of input file
  --matfile-variable-name TEXT    variable name of adjacency matrix inside a
                                  .mat file.
  --undirected / --directed       Treat graph as undirected.
  --sep TEXT                      Separator of input file
  --help                          Show this message and exit.
  1. --format adjlist for an adjacency list, e.g:

     1 2 3 4 5 6 7 8 9 11 12 13 14 18 20 22 32
     2 1 3 4 8 14 18 20 22 31
     3 1 2 4 8 9 10 14 28 29 33
     ...
    
  2. --format edgelist for an edge list, e.g:

     1 2
     1 3
     1 4
     ...
    
  3. --format weighted_edgelist for an edge list, e.g:

     1 2 0.1
     1 3 2
     1 4 0.5
     ...
    
  4. --format mat for a Matlab MAT file containing an adjacency matrix (note, you must also specify the variable name of the adjacency matrix --matfile-variable-name)

Working with embeddings in Python

Michael Loster provided an example of working with the embedding file from Python. After learning the embeddings the saved binary file can be used the following way:

# The binary file that is the output of the compiled verse binary.
embedding_file = "/path/to/binary/embeddings.bin"

# An optional csv that should contain the mapping of id to some string key.
# E.g., each line should look like "0,http://dbpedia.org/resource/Audi".
index_file = "/path/to/uri/id/mapping.csv"

# Our embeddings have 128 dimensions.
embeddings = Embedding(embedding_file, 128, index_file)
audi_embedding = embeddings['http://dbpedia.org/resource/Audi']

Citation

If you use the code or the datasets, please consider citing the paper:

@inproceedings{Tsitsulin:2018:VVG:3178876.3186120,
    author = {Tsitsulin, Anton and Mottin, Davide and Karras, Panagiotis and M\"{u}ller, Emmanuel},
    title = {VERSE: Versatile Graph Embeddings from Similarity Measures},
    booktitle = {Proceedings of the 2018 World Wide Web Conference},
    series = {WWW '18},
    year = {2018},
    isbn = {978-1-4503-5639-8},
    location = {Lyon, France},
    pages = {539--548},
    numpages = {10},
    url = {https://doi.org/10.1145/3178876.3186120},
    doi = {10.1145/3178876.3186120},
    acmid = {3186120},
    publisher = {International World Wide Web Conferences Steering Committee},
    address = {Republic and Canton of Geneva, Switzerland},
    keywords = {feature learning, graph embedding, graph representations, information networks, node embedding, vertex similarity},
}

Contact

echo "%'_-|'