benedekrozemberczki/graph2vec
A parallel implementation of “graph2vec: Learning Distributed Representations of Graphs” (MLGWorkshop 2017).
repo name | benedekrozemberczki/graph2vec |
repo link | https://github.com/benedekrozemberczki/graph2vec |
homepage | https://karateclub.readthedocs.io/ |
language | Python |
size (curr.) | 208 kB |
stars (curr.) | 490 |
created | 2018-07-10 |
license | GNU General Public License v3.0 |
graph2vec
Abstract
The model is now also available in the package Karate Club.
This repository provides an implementation for graph2vec as it is described in:
graph2vec: Learning distributed representations of graphs. Narayanan, Annamalai and Chandramohan, Mahinthan and Venkatesan, Rajasekar and Chen, Lihui and Liu, Yang MLG 2017, 13th International Workshop on Mining and Learning with Graphs (MLGWorkshop 2017).
The original TensorFlow implementation 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.
jsonschema 2.6.0
tqdm 4.28.1
numpy 1.15.4
pandas 0.23.4
texttable 1.5.0
gensim 3.6.0
networkx 2.4
joblib 0.13.0
logging 0.4.9.6
Datasets
Options
Learning of the embedding is handled by the src/graph2vec.py
script which provides the following command line arguments.
Input and output options
--input-path STR Input folder. Default is `dataset/`.
--output-path STR Embeddings path. Default is `features/nci1.csv`.
Model options
--dimensions INT Number of dimensions. Default is 128.
--workers INT Number of workers. Default is 4.
--epochs INT Number of training epochs. Default is 1.
--min-count INT Minimal feature count to keep. Default is 5.
--wl-iterations INT Number of feature extraction recursions. Default is 2.
--learning-rate FLOAT Initial learning rate. Default is 0.025.
--down-sampling FLOAT Down sampling rate for frequent features. Default is 0.0001.
Examples
$ python src/graph2vec.py
Creating an embedding of an other dataset. Saving the output in a custom place.
$ python src/graph2vec.py --input-path new_data/ --output-path features/nci2.csv
Creating an embedding of the default dataset in 32 dimensions.
$ python src/graph2vec.py --dimensions 32