Skip to content

Commit

Permalink
Prepare for v0.3.0 release (#516)
Browse files Browse the repository at this point in the history
* Bump version to 0.3.0

* Add release notes

* Minor corrections in notebooks

Co-authored-by: wreise <[email protected]>
  • Loading branch information
ulupo and wreise authored Oct 8, 2020
1 parent ef19301 commit 8f5c2ef
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 12 deletions.
4 changes: 2 additions & 2 deletions doc/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ What's new

.. include::
release.rst
:start-after: Release 0.2.2
:end-before: Release 0.2.1
:start-after: Release 0.3.0
:end-before: Release 0.2.2
6 changes: 6 additions & 0 deletions doc/modules/homology.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Undirected simplicial homology

Directed simplicial homology
----------------------------
.. currentmodule:: gtda

.. autosummary::
:toctree: generated/homology/
:template: class.rst

homology.FlagserPersistence

Cubical homology
Expand Down
183 changes: 182 additions & 1 deletion doc/release.rst

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/MNIST_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Create train and test sets"
"### Create train and test sets"
]
},
{
Expand Down Expand Up @@ -149,7 +149,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Binarize the image"
"### Binarize the image"
]
},
{
Expand Down Expand Up @@ -491,7 +491,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Training a classifier"
"## Training a classifier"
]
},
{
Expand Down
8 changes: 6 additions & 2 deletions examples/persistent_homology_graphs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"To understand what these persistence diagrams are telling us about the input weighted graphs, we briefly explain the **clique complex (or flag complex) filtration** procedure underlying the computations in ``VietorisRipsPersistence`` when ``metric=\"precomputed\"``, via an example.\n",
"\n",
"Let us start with a special case of a weighted graph with adjacency matrix as follows:\n",
"\n",
"- the diagonal entries (\"vertex weights\") are all zero;\n",
"- all off-diagonal entries (edge weights) are non-negative;\n",
"- some edge weights are infinite (or very very large).\n",
Expand All @@ -141,6 +142,7 @@
"The procedure can be explained as follows: we let a parameter $\\varepsilon$ start at 0, and as we increase it all the way to infinity we keep considering the instantaneous subgraphs made of a) all the vertices in the original graph, and b) those edges whose weight is less than or equal to the current $\\varepsilon$. We also promote these subgraphs to more general structures called **(simplicial) complexes** that, alongside vertices and edges, also possess $k$**-simplices**, i.e. selected subsets of $k + 1$ vertices (a 2-simplex is an abstract \"triangle\", a 3-simplex an abstract \"tetrahedron\", etc). Our criterion is this: for each integer $k \\geq 2$, all $(k + 1)$-cliques in each instantaneous subgraph are declared to be the $k$-simplices of the subgraph's associated complex. By definition, the $0$-simplices are the vertices and the $1$-simplices are the available edges.\n",
"\n",
"As $\\varepsilon$ increases from 0 (included) to infinity, we record the following information:\n",
"\n",
"1. How many new **connected components** are created because of the appearance of vertices (in this example, all vertices \"appear\" in one go at $\\varepsilon = 0$, by definition!), or merge because of the appearance of new edges.\n",
"2. How many new 1-dimensional \"holes\", 2-dimensional \"cavities\", or more generally $d$-dimensional **voids** are created in the instantaneous complex. A hole, cavity, or $d$-dimensional void is such only if there is no collection of \"triangles\", \"tetrahedra\", or $(d + 1)$-simplices which the void is the \"boundary\" of. *Note*: Although the edges of a triangle *alone* \"surround a hole\", these cannot occur in our particular construction because the \"filling\" triangle is also declared present in the complex when all its edges are.\n",
"3. How many $d$-dimensional voids which were present at earlier values of $\\epsilon$ are \"filled\" by $(d + 1)$-simplices which just appear.\n",
Expand Down Expand Up @@ -242,6 +244,7 @@
"And just as in the case of weighted graphs, we record the appearance/disappearance of connected components and voids as we keep increasing $r$.\n",
"\n",
"The case of point clouds can actually be thought of as a special case of the case of FCW graphs. Namely, if:\n",
"\n",
"1. we regard each point in the cloud as an abstract vertex in a graph,\n",
"2. we compute the square matrix of pairwise (Euclidean or other) distances between points in the cloud, and\n",
"3. we run the procedure explained above with $\\varepsilon$ defined as $2r$,\n",
Expand Down Expand Up @@ -278,8 +281,9 @@
"What if, as is the case in many applications, our graphs have sparse connections and are unweighted?\n",
"\n",
"In ``giotto-tda``, there are two possibilities:\n",
"1. One can encode the graphs as adjacency matrices of non-fully connected weighted graphs, where all weights corresponding to edges which are present are equal to ``1.`` (or any other positive constant). See section ***Non-fully connected weighted graphs*** above for the different encoding conventions for sparse and dense matrices.\n",
"2. One can preprocess the unweighted graph via [GraphGeodesicDistance](https://giotto-ai.github.io/gtda-docs/latest/modules/generated/graphs/processing/gtda.graphs.GraphGeodesicDistance.html) to obtain a FCW graph where edge $ij$ has as weight the length of the shortest path from vertex $i$ to vertex $j$ (and ``np.inf`` if no path exists between the two vertices in the original graph).\n",
"\n",
"1. Encode the graphs as adjacency matrices of non-fully connected weighted graphs, where all weights corresponding to edges which are present are equal to ``1.`` (or any other positive constant). See section ***Non-fully connected weighted graphs*** above for the different encoding conventions for sparse and dense matrices.\n",
"2. Preprocess the unweighted graph via [GraphGeodesicDistance](https://giotto-ai.github.io/gtda-docs/latest/modules/generated/graphs/processing/gtda.graphs.GraphGeodesicDistance.html) to obtain a FCW graph where edge $ij$ has as weight the length of the shortest path from vertex $i$ to vertex $j$ (and ``np.inf`` if no path exists between the two vertices in the original graph).\n",
"\n",
"### Example 1: Circle graph\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/vietoris_rips_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Important note**: ``VietorisRipsPersistence``, and all other \"persistence homology\" transformers in ``gtda.homology``, expect input in the form of a 3D array or, in some cases, a list of 2D arrays. For each entry in the input (here, for each point cloud in ``point_clouds``) they compute a topological summary which is also a 2D array, and then stack all these summaries into a single output 3D array. So, in our case, ``diagrams[i]`` represents the topology of ``point_clouds[i]``. ``diagrams[i]`` is interpreted as follows:\n",
"**Important note**: ``VietorisRipsPersistence``, and all other \"persistent homology\" transformers in ``gtda.homology``, expect input in the form of a 3D array or, in some cases, a list of 2D arrays. For each entry in the input (here, for each point cloud in ``point_clouds``) they compute a topological summary which is also a 2D array, and then stack all these summaries into a single output 3D array. So, in our case, ``diagrams[i]`` represents the topology of ``point_clouds[i]``. ``diagrams[i]`` is interpreted as follows:\n",
"- Each row is a triplet describing a single topological feature found in ``point_clouds[i]``.\n",
"- The first and second entries (respectively) in the triplet denote the values of the \"filtration parameter\" at which the feature appears or disappears respectively. They are referred to as the \"birth\" and \"death\" values of the feature (respectively). The meaning of \"filtration parameter\" depends on the specific transformer, but in the case of ``VietorisRipsPersistence`` on point clouds it has the interpretation of a length scale.\n",
"- A topological feature can be a connected component, 1D hole/loop, 2D cavity, or more generally $d$-dimensional \"void\" which exists in the data at scales between its birth and death values. The integer $d$ is the *homology dimension* (or degree) of the feature and is stored as the third entry in the triplet. In this example, the shapes should have 2D cavities so we explicitly tell ``VietorisRipsPersistence`` to look for these by using the ``homology_dimensions`` parameter!\n",
Expand Down
2 changes: 1 addition & 1 deletion gtda/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#

__version__ = '0.2.2'
__version__ = "0.3.0"
2 changes: 1 addition & 1 deletion gtda/diagrams/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def transform(self, X, y=None):
Xt : ndarray of shape (n_samples, n_features_filtered, 3)
Filtered persistence diagrams. Only the subdiagrams corresponding
to dimensions in :attr:`homology_dimensions_` are filtered.
``n_features_filtered`` is less than or equal to ``n_features`.
``n_features_filtered`` is less than or equal to ``n_features``.
"""
check_is_fitted(self)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
MAINTAINER_EMAIL = "[email protected]"
URL = "https://github.com/giotto-ai/giotto-tda"
LICENSE = "GNU AGPLv3"
DOWNLOAD_URL = "https://github.com/giotto-ai/giotto-tda/tarball/v0.2.2"
DOWNLOAD_URL = "https://github.com/giotto-ai/giotto-tda/tarball/v0.3.0"
VERSION = __version__ # noqa
CLASSIFIERS = ["Intended Audience :: Science/Research",
"Intended Audience :: Developers",
Expand Down

0 comments on commit 8f5c2ef

Please sign in to comment.