Skip to main content

diagram2vec

Diagram2vec provides the following finite-dimensional vector representations of the persistence diagrams:

  • persistence statistics (statistics of quanitites such as persistence, midlife, mult.life)
  • Euler characteristic curve
  • k-th Betti number curves
  • persistence curves (curves of quanitites such as persistence, midlife, multitplicative life)
  • entropy curves (curves of entropy of quanitites such as persistence, midlife, multitplicative life)
  • Adcock-Carlsson polynomials (https://arxiv.org/abs/1304.0530)

All representations have ε-robust versions, i.e. not taking into account intervals with persistence below a certain threshold function.

Installation

Dependencies

  • python (>= 3.6)
  • numpy
  • scipy

The latest version of the diagram2vec can be installed with pip:

pip install diagram2vec

Example of usage

import diagram2vec

# list of lists of ndarrays, representing a collection of persistence diagrams
diagrams = [
    [np.array([[0.0, np.inf], [0.0, 0.4], [0.0, 0.5]]), np.array([[0.1, 0.6], [0.2, 0.4]])], 
    [np.array([[0.0, np.inf], [0.0, 0.1]]), np.array([[0.4, 0.7]])],
]

# compute a list of statistics of a distribution of the persistence p := (d - b) quantity
stats = diagram2vec.statistics(diagrams, quantity="persistence", statistics=["min", "mean", "count"])

# compute an Euler characteristic curve (a vector of dimension 10)
euler_curve = diagram2vec.euler_curve(diagrams, m=10)

# compute a Betti number curve, which is default quantity for the `persistence_curve`
# (a vector of dimension 50, intervals with persistence below 0.05 are not used)
betti_curve = diagram2dec.persistence_curve(diagrams, m=50, f="linear", b=0.05)

# compute a curve of persistence quantity
# available quanities: 'betti', 'persistence', 'midlife', 'multlife'
persistence_curve = diagram2vec.persistence_curve(diagrams, quantity="persistence", m=50)

# compute a curve of midlife entropy
# available quanities: 'persistence', 'midlife', 'multlife'
entropy_curve = diagram2vec.entropy_curve(diagrams, quantity="midlife", m=20)

# compute Adcock-Carlsson polynomials
polynomials = diagram2vec.polynomials(diagrams, terms=[["birth", "persistence"], ["dmax", "persistence"]], powers=[[1, 1], [2, 4]])

Release files for diagram2vec 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for diagram2vec 0.0.2
File Interpreter ABI Platform
diagram2vec-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / diagram2vec-0.0.2-py3-none-any.whl

Download URL diagram2vec-0.0.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4edaea15b70daeac1ba8397c23a7f8ef669f1d3bca101754e44bbc7e084d0231
BLAKE2b-256 checksum
How to use checksums
c441a20b398321e2d6e438be92b873aff8581bb418f1dd9ed55ce899ce309485
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page