Graph Signal Processing in Python
Project description
The PyGSP is a Python package to ease Signal Processing on Graphs. It is a free software, distributed under the BSD license, and available on PyPI. The documentation is available on Read the Docs and development takes place on GitHub. (A Matlab counterpart 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.estimate_lmax() >>> g = filters.Heat(G, tau=100)
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, backend='matplotlib')
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 the package!
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.
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”.
If you are using the library for your research, for the sake of reproducibility, please cite the version you used as indexed by Zenodo.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PyGSP-0.5.1.tar.gz
.
File metadata
- Download URL: PyGSP-0.5.1.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4874ad88793d622d4f578b40c6617a99b1f02bc6c6c4077f0e48cd71c7275800 |
|
MD5 | 6fb5ee9f1f25acd3c37c9d5c3ec3a8a4 |
|
BLAKE2b-256 | 877878793c753799de6f2728213a46867cd2ab756242f22a205c7a29aec05395 |
File details
Details for the file PyGSP-0.5.1-py2.py3-none-any.whl
.
File metadata
- Download URL: PyGSP-0.5.1-py2.py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 884765260256f143a92053c420797053fda0f4eba1573471526fb4e62a4c4cde |
|
MD5 | 961382b592faf447d50b7e44515ca5fd |
|
BLAKE2b-256 | d4892f4aa73cccf12bec5179ac5d52a68b508120c838b7e5d456f5ea0c8beade |