pygmtools

A Python Graph Matching Toolkit.

https://github.com/thinklab-sjtu/pygmtools

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    4 of 15 committers (26.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.9%) to scientific vocabulary

Keywords

combinatorial-optimization deep-learning graph-matching python-library

Keywords from Contributors

sequencing pdes interactive optim operating-system numerical state-management notebook knowledge-graphs rdf
Last synced: 6 months ago · JSON representation

Repository

A Python Graph Matching Toolkit.

Basic Info
Statistics
  • Stars: 339
  • Watchers: 4
  • Forks: 19
  • Open Issues: 2
  • Releases: 31
Topics
combinatorial-optimization deep-learning graph-matching python-library
Created over 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

pygmtools: Python Graph Matching Tools

PyPi version PyPI pyversions Downloads Documentation Status codecov discord channel QQ group GitHub stars


News pygmtools is published in JMLR! Please cite our paper if our tools are useful in your research!


pygmtools (Python Graph Matching Tools) provides graph matching solvers in Python and is easily accessible via:

bash $ pip install pygmtools

Official documentation: https://pygmtools.readthedocs.io

Source code: https://github.com/Thinklab-SJTU/pygmtools

Graph matching is a fundamental yet challenging problem in pattern recognition, data mining, and others. Graph matching aims to find node-to-node correspondence among multiple graphs, by solving an NP-hard combinatorial optimization problem.

Doing graph matching in Python used to be difficult, and this library wants to make researchers' lives easier. To highlight, pygmtools has the following features:

  • Support various solvers, including traditional combinatorial solvers (including linear, quadratic, and multi-graph) and novel deep learning-based solvers;
  • Support various backends, including numpy which is universally accessible, and some state-of-the-art deep learning architectures with GPU support: pytorch, paddle, jittor, tensorflow, mindspore;
  • Deep learning friendly, the operations are designed to best preserve the gradient during computation and batched operations support for the best performance.

Installation

You can install the stable release on PyPI:

bash $ pip install pygmtools

or get the latest version by running:

bash $ pip install -U https://github.com/Thinklab-SJTU/pygmtools/archive/master.zip # with --user for user install (no root)

Now the pygmtools is available with the numpy backend.

The following packages are required, and shall be automatically installed by pip:

Python >= 3.8 requests >= 2.25.1 scipy >= 1.4.1 Pillow >= 7.2.0 numpy >= 1.18.5 easydict >= 1.7 appdirs >= 1.4.4 tqdm >= 4.64.1 networkx >= 2.8.8 aiohttp async-timeout

Available Graph Matching Solvers

This library offers user-friendly API for the following solvers:

Available Backends

This library is designed to support multiple backends with the same set of API. Please follow the official instructions to install your backend.

The following backends are available:

  • Numpy (default backend, CPU only)

numpy logo

  • PyTorch (GPU friendly, deep learning friendly)

pytorch logo

  • Jittor (GPU friendly, JIT support, deep learning friendly)

jittor logo

paddle logo

  • Tensorflow (GPU friendly, deep learning friendly)

tensorflow logo

Development status

| | Numpy | PyTorch | Jittor | PaddlePaddle | Tensorflow | MindSpore | | ------------------- | ----- | ------- | ------ | ------------ | ---------- | --------- | | Linear Solvers | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | Classic Solvers | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | Multi-Graph Solvers | ✔ | ✔ | ✔ | ✔ | 📆 | 📆 | | Neural Solvers | ✔ | ✔ | ✔ | ✔ | 📆 | 📆 | | Examples Gallery | ✔ | ✔ | ✔ | ✔ | 📆 | 📆 |

✔: Supported; 📆: Planned for future versions (contributions welcomed!).

For more details, please read the documentation.

Pretrained Models

The library includes several neural network solvers. The pretrained models shall be automatically downloaded upon needed from Google Drive. If you are experiencing issues accessing Google Drive, please download the pretrained models manually and put them at ~/.cache/pygmtools (for Linux).

Available at: [google drive] [baidu drive]

The Deep Graph Matching Benchmark

pygmtools is also featured with a standard data interface of several graph matching benchmarks. Please read the corresponding documentation for details.

We also maintain a repository containing non-trivial implementation of deep graph matching models, please check out ThinkMatch if you are interested!

Chat with the Community

If you have any questions, or if you are experiencing any issues, feel free to raise an issue on GitHub.

We also offer the following chat rooms if you are more comfortable with them:

  • Discord (for English speakers):

discord

  • QQ Group (for Chinese speakers)/QQ群(中文用户): 696401889

ThinkMatch/pygmtools交流群

Contributing

Any contributions/ideas/suggestions from the community is welcomed! Before starting your contribution, please read the Contributing Guide.

Developers and Maintainers

pygmtools is developed and maintained by members from ThinkLab at Shanghai Jiao Tong University.

Citing Pygmtools

pygmtools is published on Journal of Machine Learning Research (JMLR). If you find our toolkit helpful in your research, please cite: Runzhong Wang, Ziao Guo, Wenzheng Pan, Jiale Ma, Yikai Zhang, Nan Yang, Qi Liu, Longxuan Wei, Hanxue Zhang, Chang Liu, Zetian Jiang, Xiaokang Yang, and Junchi Yan. Pygmtools: A Python Graph Matching Toolkit. Journal of Machine Learning Research, 25(33):1−7, 2024.

In Bibtex format: @article{wang2024pygm, author = {Runzhong Wang and Ziao Guo and Wenzheng Pan and Jiale Ma and Yikai Zhang and Nan Yang and Qi Liu and Longxuan Wei and Hanxue Zhang and Chang Liu and Zetian Jiang and Xiaokang Yang and Junchi Yan}, title = {Pygmtools: A Python Graph Matching Toolkit}, journal = {Journal of Machine Learning Research}, year = {2024}, volume = {25}, number = {33}, pages = {1-7}, url = {https://jmlr.org/papers/v25/23-0572.html}, }

References

[1] Sinkhorn, Richard, and Paul Knopp. "Concerning nonnegative matrices and doubly stochastic matrices." Pacific Journal of Mathematics 21.2 (1967): 343-348.

[2] Munkres, James. "Algorithms for the assignment and transportation problems." Journal of the Society for Industrial and Applied Mathematics 5.1 (1957): 32-38.

[3] Leordeanu, Marius, and Martial Hebert. "A spectral technique for correspondence problems using pairwise constraints." International Conference on Computer Vision (2005).

[4] Cho, Minsu, Jungmin Lee, and Kyoung Mu Lee. "Reweighted random walks for graph matching." European conference on Computer Vision (2010).

[5] Leordeanu, Marius, Martial Hebert, and Rahul Sukthankar. "An integer projected fixed point method for graph matching and map inference." Advances in Neural Information Processing Systems 22 (2009).

[6] Yan, Junchi, et al. "Multi-graph matching via affinity optimization with graduated consistency regularization." IEEE Transactions on Pattern Analysis and Machine Intelligence 38.6 (2015): 1228-1242.

[7] Jiang, Zetian, Tianzhe Wang, and Junchi Yan. "Unifying offline and online multi-graph matching via finding shortest paths on supergraph." IEEE Transactions on Pattern Analysis and Machine Intelligence 43.10 (2020): 3648-3663.

[8] Solé-Ribalta, Albert, and Francesc Serratosa. "Graduated assignment algorithm for multiple graph matching based on a common labeling." International Journal of Pattern Recognition and Artificial Intelligence 27.01 (2013): 1350001.

[9] Wang, Runzhong, Junchi Yan, and Xiaokang Yang. "Unsupervised Learning of Graph Matching with Mixture of Modes via Discrepancy Minimization." IEEE Transactions on Pattern Analysis and Machine Intelligence 45.8 (2023): 10500-10518.

[10] Wang, Runzhong, Junchi Yan, and Xiaokang Yang. "Combinatorial learning of robust deep graph matching: an embedding based approach." IEEE Transactions on Pattern Analysis and Machine Intelligence 45.6 (2023): 6984-7000.

[11] Yu, Tianshu, et al. "Learning deep graph matching with channel-independent embedding and hungarian attention." International Conference on Learning Representations. 2019.

[12] Wang, Runzhong, Junchi Yan, and Xiaokang Yang. "Neural graph matching network: Learning lawler’s quadratic assignment problem with extension to hypergraph and multiple-graph matching." IEEE Transactions on Pattern Analysis and Machine Intelligence 44.9 (2022): 5261-5279.

[13] Wang, Runzhong, Junchi Yan, and Xiaokang Yang. "Combinatorial Learning of Graph Edit Distance via Dynamic Embedding." IEEE/CVF Conference on Computer Vision and Pattern Recognition (2021): 5241-5250.

Owner

  • Name: Thinklab@SJTU
  • Login: Thinklab-SJTU
  • Kind: organization
  • Location: Shanghai

Thinklab at Shanghai Jiao Tong University, led by Prof. Junchi Yan.

GitHub Events

Total
  • Issues event: 4
  • Watch event: 40
  • Issue comment event: 3
  • Push event: 4
  • Pull request event: 2
  • Fork event: 2
Last Year
  • Issues event: 4
  • Watch event: 40
  • Issue comment event: 3
  • Push event: 4
  • Pull request event: 2
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 538
  • Total Committers: 15
  • Avg Commits per committer: 35.867
  • Development Distribution Score (DDS): 0.424
Past Year
  • Commits: 6
  • Committers: 2
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
roger 1****w 310
1115712590 1****0@q****m 64
Wenzheng Pan 1****r 61
Butcher 1****6@s****n 41
519030910351 1****0@s****n 19
heatingma 1****a 13
Ziao Guo 5****0 6
Nan Yang 1****n 6
Nan Yang y****n@1****m 4
Benson Muite b****t 4
Chang Liu o****r@s****n 3
Zetian Jiang M****t@s****n 3
dependabot[bot] 4****] 2
The Gitter Badger b****r@g****m 1
wlxlatiao666 1****6 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 35
  • Total pull requests: 153
  • Average time to close issues: 13 days
  • Average time to close pull requests: 5 days
  • Total issue authors: 15
  • Total pull request authors: 10
  • Average comments per issue: 2.91
  • Average comments per pull request: 0.83
  • Merged pull requests: 126
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: 2 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • bkmgit (3)
  • maberrospi (2)
  • grdiv (2)
  • zjt34 (2)
  • liyufeng183 (1)
  • ogencoglu (1)
  • xielinzhen (1)
  • sebastianstricker (1)
  • lansfair (1)
  • lwpyh (1)
  • sjtuytc (1)
  • chowkamlee81 (1)
  • wyupupup (1)
  • xiachenrui (1)
  • YCaigogogo (1)
Pull Request Authors
  • heatingma (21)
  • wzever (20)
  • rogerwwww (15)
  • ziao-guo (7)
  • OolongBlender (6)
  • Arist12 (5)
  • wlxlatiao666 (3)
  • bkmgit (3)
  • dependabot[bot] (2)
  • gitter-badger (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 562 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 5
  • Total versions: 67
  • Total maintainers: 3
pypi.org: pygmtools

pygmtools provides graph matching solvers in Python API and supports numpy and pytorch backends. pygmtools also provides dataset API for standard graph matching benchmarks.

  • Versions: 67
  • Dependent Packages: 0
  • Dependent Repositories: 5
  • Downloads: 562 Last month
Rankings
Dependent repos count: 6.7%
Downloads: 7.9%
Average: 8.2%
Dependent packages count: 10.0%
Maintainers (3)
Last synced: 6 months ago

Dependencies

.github/workflows/python-package.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v3 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
docs/requirements.txt pypi
  • appdirs >=1.4.4
  • easydict *
  • jittor *
  • m2r2 *
  • matplotlib *
  • networkx *
  • pygmtools *
  • pyyaml *
  • scikit-learn *
  • sphinx ==5.2.3
  • sphinx-design ==0.3.0
  • sphinx-gallery ==0.11.1
  • sphinx_rtd_theme ==1.0.0
  • torch ==1.10.1
  • torchvision ==0.11.2
  • tqdm *
  • wget *
tests/requirements.txt pypi
  • Pillow >=7.2.0 test
  • appdirs >=1.4.4 test
  • easydict >=1.7 test
  • jittor * test
  • numpy >=1.18.5 test
  • paddlepaddle * test
  • protobuf ==3.19.5 test
  • requests >=2.25.1 test
  • scipy >=1.4.1 test
  • tensorflow ==2.9.3 test
  • torch * test
  • tqdm * test
  • wget * test