Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine documentations and examples. #74

Merged
merged 2 commits into from
Aug 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 26 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to pygmtools
# Contributing to pygmtools: Developer Documentation

First, thank you for contributing to ``pygmtools``!

Expand Down Expand Up @@ -169,5 +169,30 @@ intuition to the reader on what the algorithm does. It is best to always
start with a small paragraph with a hand-waving explanation of what the
method does to the data.

## Notes for Developers

Here we show some ideas to help developers better understand our designs and contribute to ``pygmtools``.

### Multiple Numerical Backends
``pygmtools`` supports multiple backends including ``numpy``, ``pytorch``, ``jittor``, ``paddle``, aiming to
cater to a broader audience of researchers and practitioners. Each backend might have its strengths and performance
characteristics, making it beneficial to provide multiple options for users.

### Unified API
Despite supporting multiple backends, ``pygmtools`` could present a unified API for its functionalities. This makes it
easier for users to switch between different backends, enhancing its ease of use and maintainability.

### Documentation-Driven Development
We put a strong emphasis on comprehensive and user-friendly documentation. ``pygmtools`` should include usage examples,
tutorials, and clear explanations for each component, making it easier for users and contributors to understand and
utilize the toolkit.

### Performance Benchmarks
We compare the algorithms and numerical backends under various conditions, aiming to provide users with empirical data
to guide their selection of the most suitable solvers/algorithms for their specific use cases.

### Open-Source Collaboration
Emphasizing open-source principles and collaborative development is likely a key idea. We encourage open
discussions, peer reviews, and community engagement to improve the quality and scope of the toolkit.

This Contribution guide is strongly inpired by the one of the [scikit-learn](https://github.com/scikit-learn/scikit-learn) team.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Introduction: Matching Isomorphic Graphs\n\nThis example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.\nIsomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.\n"
"\n# Jittor Backend Example: Matching Isomorphic Graphs\n\nThis example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.\nIsomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding: utf-8
"""
========================================
Introduction: Matching Isomorphic Graphs
========================================
==================================================
Jittor Backend Example: Matching Isomorphic Graphs
==================================================

This example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.
Isomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2f0f2c7c1ef1f5fe8b1c9e88301ef680
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/jittor/plot_isomorphic_graphs_jittor.py"
.. "auto_examples/1.matching_isomorphic_graphs/plot_isomorphic_graphs_jittor.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

.. note::
:class: sphx-glr-download-link-note

Click :ref:`here <sphx_glr_download_auto_examples_jittor_plot_isomorphic_graphs_jittor.py>`
Click :ref:`here <sphx_glr_download_auto_examples_1.matching_isomorphic_graphs_plot_isomorphic_graphs_jittor.py>`
to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_jittor_plot_isomorphic_graphs_jittor.py:
.. _sphx_glr_auto_examples_1.matching_isomorphic_graphs_plot_isomorphic_graphs_jittor.py:


========================================
Introduction: Matching Isomorphic Graphs
========================================
==================================================
Jittor Backend Example: Matching Isomorphic Graphs
==================================================

This example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.
Isomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.
Expand Down Expand Up @@ -129,9 +129,9 @@ Visualize the graphs



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_001.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_001.png
:alt: Graph 1, Graph 2
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_001.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_001.png
:class: sphx-glr-single-img


Expand Down Expand Up @@ -192,9 +192,9 @@ has :math:`N^2\times N^2` elements because there are :math:`N^2` edges in each g



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_002.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_002.png
:alt: Affinity Matrix (size: 100$\times$100)
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_002.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_002.png
:class: sphx-glr-single-img


Expand All @@ -203,7 +203,7 @@ has :math:`N^2\times N^2` elements because there are :math:`N^2` edges in each g
.. code-block:: none


<matplotlib.image.AxesImage object at 0x7feef6f66820>
<matplotlib.image.AxesImage object at 0x7fa046866eb0>



Expand Down Expand Up @@ -247,9 +247,9 @@ The output of RRWM is a soft matching matrix. Visualization:



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_003.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_003.png
:alt: RRWM Soft Matching Matrix, Ground Truth Matching Matrix
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_003.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_003.png
:class: sphx-glr-single-img


Expand All @@ -258,7 +258,7 @@ The output of RRWM is a soft matching matrix. Visualization:
.. code-block:: none


<matplotlib.image.AxesImage object at 0x7feef71d4430>
<matplotlib.image.AxesImage object at 0x7fa048131f40>



Expand Down Expand Up @@ -302,9 +302,9 @@ Visualization of the discrete matching matrix:



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_004.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_004.png
:alt: RRWM Matching Matrix (acc=1.00), Ground Truth Matching Matrix
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_004.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_004.png
:class: sphx-glr-single-img


Expand All @@ -313,7 +313,7 @@ Visualization of the discrete matching matrix:
.. code-block:: none


<matplotlib.image.AxesImage object at 0x7feef6946b20>
<matplotlib.image.AxesImage object at 0x7fa0483d8be0>



Expand Down Expand Up @@ -344,9 +344,9 @@ Draw the matching (green lines for correct matching, red lines for wrong matchin



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_005.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_005.png
:alt: Graph 1, Graph 2
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_005.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_005.png
:class: sphx-glr-single-img


Expand Down Expand Up @@ -381,9 +381,9 @@ Align the nodes:



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_006.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_006.png
:alt: Graph 1, Aligned Graph 2
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_006.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_006.png
:class: sphx-glr-single-img


Expand Down Expand Up @@ -433,9 +433,9 @@ Visualization of IPFP matching result:



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_007.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_007.png
:alt: IPFP Matching Matrix (acc=1.00), Ground Truth Matching Matrix
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_007.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_007.png
:class: sphx-glr-single-img


Expand All @@ -444,7 +444,7 @@ Visualization of IPFP matching result:
.. code-block:: none


<matplotlib.image.AxesImage object at 0x7feef5a85940>
<matplotlib.image.AxesImage object at 0x7fa0489e2d30>



Expand Down Expand Up @@ -489,9 +489,9 @@ Visualization of SM matching result:



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_008.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_008.png
:alt: SM Matching Matrix (acc=1.00), Ground Truth Matching Matrix
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_008.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_008.png
:class: sphx-glr-single-img


Expand All @@ -500,7 +500,7 @@ Visualization of SM matching result:
.. code-block:: none


<matplotlib.image.AxesImage object at 0x7feef6b3e160>
<matplotlib.image.AxesImage object at 0x7fa046985070>



Expand Down Expand Up @@ -545,9 +545,9 @@ Visualization of NGM matching result:



.. image-sg:: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_009.png
.. image-sg:: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_009.png
:alt: NGM Matching Matrix (acc=1.00), Ground Truth Matching Matrix
:srcset: /auto_examples/jittor/images/sphx_glr_plot_isomorphic_graphs_jittor_009.png
:srcset: /auto_examples/1.matching_isomorphic_graphs/images/sphx_glr_plot_isomorphic_graphs_jittor_009.png
:class: sphx-glr-single-img


Expand All @@ -556,17 +556,17 @@ Visualization of NGM matching result:
.. code-block:: none


<matplotlib.image.AxesImage object at 0x7feef3e7e280>
<matplotlib.image.AxesImage object at 0x7fa046826c70>




.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 0 minutes 16.270 seconds)
**Total running time of the script:** ( 0 minutes 7.989 seconds)


.. _sphx_glr_download_auto_examples_jittor_plot_isomorphic_graphs_jittor.py:
.. _sphx_glr_download_auto_examples_1.matching_isomorphic_graphs_plot_isomorphic_graphs_jittor.py:

.. only:: html

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Introduction: Matching Isomorphic Graphs\n\nThis example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.\nIsomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.\n"
"\n# Numpy Backend Example: Matching Isomorphic Graphs\n\nThis example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.\nIsomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# coding: utf-8
"""
========================================
Introduction: Matching Isomorphic Graphs
========================================
=================================================
Numpy Backend Example: Matching Isomorphic Graphs
=================================================

This example is an introduction to ``pygmtools`` which shows how to match isomorphic graphs.
Isomorphic graphs mean graphs whose structures are identical, but the node correspondence is unknown.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
03170a7a0d0adc3165a38da267b4becd
Loading