GithubHelp home page GithubHelp logo

stanleyjs / graph-scattering-transforms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alelab-upenn/graph-scattering-transforms

0.0 1.0 0.0 45.69 MB

Code for experimentation on graph scattering transforms

License: GNU General Public License v3.0

Python 100.00%

graph-scattering-transforms's Introduction

Graph Scattering Transforms

Code for experimentation on graph scattering transforms. If any part of this code is used, the following paper must be cited:

F. Gama, J. Bruna, and A. Ribeiro, "Stability of graph scattering transforms," arXiv:1906.04784v1 [cs.LG], 11 June 2019.

Any questions, comments or suggestions, please e-mail Fernando Gama at [email protected]. The specific random seeds used to get the results that appear in the paper can be obtained by request.

Wavelets

Graph scattering transform depend on a multi-resolution graph wavelet filter bank. This code implements three different wavelet filter banks, namely:

  1. Diffusion wavelets:

F. Gama, A. Ribeiro, and J. Bruna, "Diffusion Scattering Transforms on Graphs," in 7th Int. Conf. Learning Representations. New Orleans, LA: Assoc. Comput. Linguistics, 6-9 May 2019, pp. 1–12.

R. R. Coifman and M. Maggioni, "Diffusion wavelets," Appl. Comput. Harmonic Anal., vol. 21, no. 1, pp. 53–94, July 2006.

  1. Monic polynomials interpolated by a cubic polynomial:

D. K. Hammond, P. Vandergheynst, and R. Gribonval, "Wavelets on graphs via spectral graph theory," Appl. Comput. Harmonic Anal., vol. 30, no. 2, pp. 129–150, March 2011.

  1. Tight frames of Hann wavelets:

D. I. Shuman, C. Wiesmeyr, N. Holighaus, and P. Vandergheynst, "Spectrum-adapted tight graph wavelet and vertex-frequency frames," IEEE Trans. Signal Process., vol. 63, no. 16, pp. 4223–4235, Aug. 2015.

Datasets

Three experiments are run.

1. The first one, under the name GSTsmallWorld.py is a synthetic experiment on a small world graph. The objective of this experiment is to showcase the effect of the stability bound on graph scattering transform under a controlled environment.

D. J. Watts and S. H. Strogatz, "Collective dynamics of 'small-world' networks," Nature, vol. 393, no. 6684, pp. 440–442, June 1998.

2. The second one, on the file GSTauthorship.py considers the problem of authorship attribution. It demonstrates the richness of the graph scattering representation on a real dataset. The dataset is available under datasets/authorshipData/ and the following paper must be cited whenever such dataset is used

S. Segarra, M. Eisen, and A. Ribeiro, "Authorship attribution through function word adjacency networks," IEEE Trans. Signal Process., vol. 63, no. 20, pp. 5464–5478, Oct. 2015.

3. The third and last one, on the file GSTfacebook.py studies the problem of source localization on a subnetwork of a Facebook graph. This experiment is meant to also show the richness of the graph scattering representation under a real graph perturbation, with a synthetic signal defined on top of it. The original dataset is available here, and use of this dataset must cite the following paper

J. McAuley and J. Leskovec, "Learning to discover social circles in Ego networks," in 26th Neural Inform. Process. Syst. Stateline, TX: NIPS Foundation, 3-8 Dec. 2012.

Code

The code is written in Python3. Details as follows.

Dependencies

The following Python libraries are required: os, numpy, matplotlib, pickle, datetime, sklearn, hdf5storage, urllib, gzip, shutil and scipy, as well as a LaTeX installation.

Concept

The three main files GSTauthorship.py, GSTfacebook.py and GSTsmallWorld.py consists of the three main experiments. The first lines of code on each of those files (after importing the corresponding libraries) have the main parameters defined, which could be edited for running experiment under a different set of hyperparameters.

The directory Modules/ contains the implemented graph scattering transforms. In most cases, it has a function that just compute the corresponding equation, a wavelet function that computes the graph wavelet filter bank, and a graph scattering transform class that computes the entire representation.

Under Utils/ there are three modules containing utilitary classes and functions, such as those handling the graph graphTools.py, handling the data dataTools.py and some miscellaneous tools miscTools.py.

Run

The code runs by simply executing python GSTsmallWorld.py or any of the two other experiments (assuming python is the command for Python3). For running the authorship attribution experiment, the .rar files on datasets/ have to be uncompressed. For obtaining the entire Facebook graph, a connection to the internet is required since the dataset is download from its source.

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.