Playing with the PyGSP

https://github.com/epfl-lts2/pygsp

In [ ]:
%matplotlib inline

import numpy as np
import matplotlib.pyplot as plt
from pygsp import graphs, filters

plt.rcParams['figure.figsize'] = (17, 5)

1 Example

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

In [ ]:
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!

In [ ]:
DELTAS = [20, 30, 1090]
s = np.zeros(G.N)
s[DELTAS] = 1
s = g.filter(s)
G.plot(s, highlight=DELTAS, backend='matplotlib')

2 Tutorials

Try to follow one of our tutorials, or go through my computational introduction to GSP in NTDS'17.

In [ ]:
# Your code here.

3 Playground

Or try anything that goes through your mind! Look at the reference guide to know more about the API.

In [ ]:
# Your code here.

If you miss a package, you can install it with:

In [ ]:
! pip install pygsp