GithubHelp home page GithubHelp logo

jb-ms / pygsp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epfl-lts2/pygsp

0.0 2.0 0.0 3.39 MB

Graph Signal Processing in Python

Home Page: https://pygsp.readthedocs.io

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.30% Jupyter Notebook 1.03% Shell 0.03% Python 98.63%

pygsp's Introduction

PyGSP: Graph Signal Processing in Python

doc pypi conda binder
zenodo license pyversions
travis coveralls github

The PyGSP is a Python package to ease Signal Processing on Graphs. The documentation is available on Read the Docs and development takes place on GitHub. A (mostly unmaintained) Matlab version exists.

The PyGSP facilitates a wide variety of operations on graphs, like computing their Fourier basis, filtering or interpolating signals, plotting graphs, signals, and filters. Its core is spectral graph theory, and many of the provided operations scale to very large graphs. The package includes a wide range of graphs, from point clouds like the Stanford bunny and the Swiss roll; to networks like the Minnesota road network; to models for generating random graphs like stochastic block models, sensor networks, Erdős–Rényi model, Barabási-Albert model; to simple graphs like the path, the ring, and the grid. Many filter banks are also provided, e.g. various wavelets like the Mexican hat, Meyer, Half Cosine; some low-pass filters like the heat kernel and the exponential window; and Gabor filters. Despite all the pre-defined models, you can easily use a custom graph by defining its adjacency matrix, and a custom filter bank by defining a set of functions in the spectral domain.

The following demonstrates how to instantiate a graph and a filter, the two main objects of the package.

>>> from pygsp import graphs, filters
>>> G = graphs.Logo()
>>> G.compute_fourier_basis()  # Fourier to plot the eigenvalues.
>>> # G.estimate_lmax() is otherwise sufficient.
>>> g = filters.Heat(G, tau=50)
>>> g.plot()

Let's now create a graph signal: a set of three Kronecker deltas for that example. We can now look at one step of heat diffusion by filtering the deltas with the above defined filter. Note how the diffusion follows the local structure!

>>> import numpy as np
>>> DELTAS = [20, 30, 1090]
>>> s = np.zeros(G.N)
>>> s[DELTAS] = 1
>>> s = g.filter(s)
>>> G.plot_signal(s, highlight=DELTAS)

You can try it online, look at the tutorials to learn how to use it, or look at the reference guide for an exhaustive documentation of the API. Enjoy!

Installation

The PyGSP is available on PyPI:

$ pip install pygsp

Note that you will need a recent version of pip and setuptools. Please run pip install --upgrade pip setuptools if you get any installation error.

The PyGSP is available on conda-forge:

$ conda install -c conda-forge pygsp

Contributing

See the guidelines for contributing in CONTRIBUTING.rst.

Acknowledgments

The PyGSP was started in 2014 as an academic open-source project for research purpose at the EPFL LTS2 laboratory. This project has been partly funded by the Swiss National Science Foundation under grant 200021_154350 "Towards Signal Processing on Graphs".

The code in this repository is released under the terms of the BSD 3-Clause license.

If you are using the library for your research, for the sake of reproducibility, please cite the version you used as indexed by Zenodo. Or cite the generic concept as:

@misc{pygsp,
  title = {PyGSP: Graph Signal Processing in Python},
  author = {Defferrard, Micha\"el and Martin, Lionel and Pena, Rodrigo and Perraudin, Nathana\"el},
  doi = {10.5281/zenodo.1003157},
  url = {https://github.com/epfl-lts2/pygsp/},
}

pygsp's People

Contributors

mdeff avatar alafaye avatar lionel-martin avatar the-glu avatar basilechatillon avatar kikohs avatar bricaud avatar nperraud avatar kalofolb avatar eiffl avatar

Watchers

James Cloos avatar Johannes Leufken avatar

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.