Git Product home page Git Product logo

gat-skip-gram's Introduction

Combine Skip Gram and Convolutional Neural Networks

Requirements

  • Python 3.6
  • Tensorflow 2
  • Pygsp
  • Scipy
  • Scikit-learn

Dataset

Datasets available:

['ENZYMES', 'PROTEINS', 'PROTEINS_full', 'MUTAG',
 'PTC_FM', 'NCI1', 'PTC_FR', 'DD',
 'DLA', 'IMDB-BINARY', 'MNIST_test']

Note: 'ENZYMES' contains 32 unconnected graphs.

Usage of the embedding method

Usage:

python3 hierarchical_skip_gram.py --task=PROTEINS --loss_type=negative_sampling --batch_size=4 --max_depth=5 --num_features=512 --num_epochs=10 --gnn_type=krylov-5 --num_tests=10 --device=0

It will:

  • train over PROTEINS dataset
  • train the model over 10 epochs with batches of size 4
  • the dimension of the embedding will be equal to 512
  • it will use GPU 0
  • the graph will be coarsened to maximum depth 5
  • the vocabulary will be extracted with Truncated Krylov layer, of depth 5
  • using negative sampling loss
  • repeat this procedure 10 times in order to generate statistics to assess the average performance

It will create a folder 'PROTEINS_weights' with:

  • the weights of the node embedder, with h5 format
  • the weights of the graph embeddings, with h5 format
  • the weights of the graph embedding, in CSV format

To test the quality of the embeddings go to https://projector.tensorflow.org/
You need to upload 'PROTEINS_weights/graph_embeddings.csv' and 'PROTEINS/PROTEINS_graph_labels.txt'

To test the quality of the embeddings just use the SVM:

python3 baselines.py --task=PROTEINS

It will print the accuracy.

This algorithm aims to produce graph embeddings with the use convolutional networks to extract vocabulary.
Then, using Skip Gram with graph embeddings as context embeddings, we generate embeddings for the graph that contain information on the vocabulary inside.
The nodes are pooled with Loukas method.

Thanks

The loukas_coarsening folder is copied from https://github.com/loukasa/graph-coarsening with only slight modifications.
My work is redistributed under the same license.

gat-skip-gram's People

Contributors

algue-rythme avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yacnnn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.