Code Monkey home page Code Monkey logo

thgsp's Introduction

drawing

Github Build Status Github Doc Status Linting Testing codecov License Code style: black


A graph signal processing toolbox built on pytorch. The repository now mainly consists of the following stuffs:

  1. GFT-based filter(banks) processing multi-dimensional signals in a Multiple Input Multiple Output(MIMO) manner.
  2. GraphQmf and GraphBiorth wavelet filter bank.
  3. Many strategies to decompose an arbitrary graph into many(usually <10) bipartite graphs.
  4. Many graph signal sampling(which differs slightly with general graph sampling) and reconstruction algorithms.

As this package is built on PyTorch and pytorch_sparse, you can easily integrate functionalities from thgsp into a PyTorch pipeline. Check the document for installation and introduction.

Table of Contents

Example

GraphQMF four channel wavelet filter bank on Minnesota

The Minnesota traffic network is 3-colorable(exactly) or 4-colorable(roughly). Hence 4-channel GraphQmf filterbank is constructed, requiring a ceil(log2(4))=2 level bipartite decomposition. The bipartite graphs are below.

The comparision between the eventual reconstructed signal and the input one.

GraphBiorth four channel wavelet filter bank for camera man.

See the full program here.

Reference

[David K Hammond, et al.] Wavelets on Graphs via Spectral Graph Theory
[Sunil K. Narang, et al.] Compact Support Biorthogonal Wavelet Filterbanks for Arbitrary Undirected Graphs
[Sunil K. Narang, et al.] Perfect Reconstruction Two-Channel Wavelet Filter Banks for Graph Structured Data
[Akie Sakiyama, et al.] Oversampled Graph Laplacian Matrix for Graph Filter Banks
[Jing Zen, et al.] Bipartite Subgraph Decomposition for Critically Sampledwavelet Filterbanks on Arbitrary Graphs
[Aamir Anis, et al.] Towards a Sampling Theorem for Signals on Arbitrary Graphs
[Aimin Jiang, et al.] Admm-based Bipartite Graph Approximation
[Yuanchao Bai, et al.] Fast graph sampling set selection using Gershgorin disc alignment, IEEE TSP, 2020
[G. Puy, et al.] Random sampling of bandlimited signals on graphs, ACHA, 2018.
[A. Sakiyama, et al.] Eigendecomposition-free sampling set selection for graph signals,IEEE TSP, 2020.
[Aamir Anis et al.] Efficient sampling set selection for bandlimited graph signals using graph spectral proxies, IEEE TSP, 2016.

Citation

@misc{thgsp,
  author = {Bowen Deng},
  title = {ThGSP: A PyTorch-based Graph Signal Processing Library},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/bwdeng20/thgsp}},
}

thgsp's People

Contributors

bwdeng20 avatar qiuyy20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

thgsp's Issues

Port `grasp_show_transform` from GraSP to thgsp

The function grasp_show_transform by Benjamin Girault and Antonio Ortega is a visualization tool of GFT already implemented in GraSP. This note summarizes the current state of grasp_show_transform implementation provided in thgsp.

  • Embedding Algorithm
    • The eigenvector of Lrw's second smallest eigenvalue
    • Equispaced embbedding
  • Sampling Method: implemented here
  • grasp_show_transform : implemented here
  • Examples: An example with USC toy graph is below.
  • Better consistence between embedding and clustering results
import numpy as np
from scipy.sparse import lil_matrix
from thgsp.datasets import Toy
from thgsp.sampling import ess_sampling
from thgsp.visual import show_transform
g = Toy()[0]
fs, U = g.spectral(lap_type="comb")
bands = np.linspace(fs[0], fs[-1], num=9) 
bands2= np.hstack([bands[:-1, None], bands[1:, None]]) # both two kinds of bands are supported
N, M = U.shape 
print(bands)
print(bands2)
sampled_nodes = ess_sampling(g.L("comb"), g.n_node, k=4)
highlights = lil_matrix((M, N))
highlights[range(M), sampled_nodes] = 1
fig, _, _ = show_transform(g, U.t(), fs, highlights, cluster=2, bands=bands)

# Before showing the figure, you can adjust the figure on many aspects, including but not limited to
# font, text, colors of axes, using APIs provided by `plotly.go.Figure` class.
fig.show()

The interactive figure will be displayed in a browser window, and one can download the static png version like the following one.
newplot (3)

Gaussian-kernel-weighted USCToy Graph with GFT based on normalized Laplacian.

ShowTransGaussianSym

Gaussian-kernel-weighted USCToy Graph with GFT based on combinatorial Laplacian.

ShowTransGaussianComb

Enhance

OS

  • Support Windows

Code Refactoring

  • Better APIs

  • Performance Boost

    • cpp and cuda implementation of all heavily-used Chebyshev tools
    • Fast traditional graph analysis can be achieved via cugraph(gpu) and networkit(cpu), smooth conversion tools will be provided.

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.