%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from pygsp import graphs, filters
plt.rcParams['figure.figsize'] = (17, 5)
The following demonstrates how to instantiate a graph and a filter, the two main objects of the package.
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!
DELTAS = [20, 30, 1090]
s = np.zeros(G.N)
s[DELTAS] = 1
s = g.filter(s)
G.plot_signal(s, highlight=DELTAS, backend='matplotlib')
# Your code here.
Or try anything that goes through your mind! Look at the reference guide to know more about the API.
# Your code here.
If you miss a package, you can install it with:
! pip install pygsp